Merge branch 'dev' into feature/oidc-env-config

This commit is contained in:
MartinNYHC
2026-07-29 13:09:20 +02:00
committed by GitHub
41 changed files with 2597 additions and 211 deletions
@@ -143,6 +143,38 @@ describe('ConnectionDiagnosticModal', () => {
spy.mockRestore();
});
it('names a refused access code when the printer said so (#2698)', async () => {
const spy = vi.spyOn(api, 'diagnosePrinter').mockResolvedValue({
...PROBLEM_RESULT,
checks: [{ id: 'mqtt_auth', status: 'fail', params: { reason: 'auth_rejected' } }],
});
renderModal({ printerId: 1, printerName: 'Test A1', onClose: vi.fn() });
await waitFor(() => expect(spy).toHaveBeenCalledTimes(1));
// States the printer refused us, instead of the hedged "most likely wrong"
// text used when all we know is that there's no session.
expect(await screen.findByText(/refused Bambuddy's credentials/i)).toBeInTheDocument();
expect(screen.queryByText(/most likely wrong/i)).not.toBeInTheDocument();
spy.mockRestore();
});
it('hedges on the mqtt_auth failure when the printer gave no reason (#2698)', async () => {
const spy = vi.spyOn(api, 'diagnosePrinter').mockResolvedValue({
...PROBLEM_RESULT,
checks: [{ id: 'mqtt_auth', status: 'fail', params: {} }],
});
renderModal({ printerId: 1, printerName: 'Test A1', onClose: vi.fn() });
await waitFor(() => expect(spy).toHaveBeenCalledTimes(1));
expect(await screen.findByText(/most likely wrong/i)).toBeInTheDocument();
expect(screen.queryByText(/refused Bambuddy's credentials/i)).not.toBeInTheDocument();
spy.mockRestore();
});
it('falls back to the generic skip text when no reason is present', async () => {
const spy = vi.spyOn(api, 'diagnosePrinter').mockResolvedValue({
...PROBLEM_RESULT,