Skip to content

Add debug_message display to self-test results (PP-3841)#202

Merged
jonathangreen merged 3 commits intomainfrom
add-self-test-debug-message
Mar 6, 2026
Merged

Add debug_message display to self-test results (PP-3841)#202
jonathangreen merged 3 commits intomainfrom
add-self-test-debug-message

Conversation

@jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Mar 6, 2026

Description

Display the debug_message field from self-test exceptions in the SelfTestResult component. When a self-test fails and the exception includes a debug_message, it is now shown below the exception message in a visually distinct block.

This was previously being sent from the backend, but not being displayed. The debug message contains helpful details, so I think it will be helpful to display.

Changes:

  • Make debug_message optional in SelfTestsException interface to match API reality
  • Conditionally render debug_message below exception messages when present and non-empty
  • Add styled .debug-description block with pre-line whitespace handling for multi-line debug output
  • Add tests covering debug_message present, empty, and absent cases

Motivation and Context

I added network diagnostic self-tests for ILS integrations that include detailed debug messages in exception responses. I didn't realize until I tested them that we weren't displaying the debug_message data in the admin UI.

Backend PR: ThePalaceProject/circulation#3114

How Has This Been Tested?

  • All existing and new Mocha tests pass (npm run test-file-ts src/components/__tests__/SelfTestResult-test.tsx)
  • Lint passes

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

Show the exception's debug_message below the exception description
when a self-test fails, giving operators more diagnostic context.
- Make debug_message optional in SelfTestsException interface to
  match API reality
- Use SCSS color variables ($gray-tint, $gray-border) instead of
  raw rgba() values
- Add "debug:" label prefix for operator scannability
- Separate debug_message assertions into their own focused test
- Add test case for debug_message field completely absent (not just
  empty string)

import * as React from "react";
import { shallow, mount } from "enzyme";
import { mount } from "enzyme";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated, but flagged by the linter since I modified this file.

export default class SelfTestResult extends React.Component<
SelfTestResultProps,
{}
Record<string, never>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated, but flagged by the linter since I modified this file.

@jonathangreen jonathangreen requested a review from a team March 6, 2026 13:15
@jonathangreen jonathangreen changed the title Add debug_message display to self-test results Add debug_message display to self-test results (PP-3841) Mar 6, 2026
Copy link
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🥇

@jonathangreen jonathangreen merged commit f86d9c8 into main Mar 6, 2026
1 check passed
@jonathangreen jonathangreen deleted the add-self-test-debug-message branch March 6, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants