fix(test): replace toBeAttached() with querySelector not-null check for spinner
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m10s
CI / OCR Service Tests (pull_request) Successful in 16s
CI / Backend Unit Tests (pull_request) Successful in 4m25s
CI / fail2ban Regex (pull_request) Successful in 40s
CI / Compose Bucket Idempotency (pull_request) Successful in 55s
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m10s
CI / OCR Service Tests (pull_request) Successful in 16s
CI / Backend Unit Tests (pull_request) Successful in 4m25s
CI / fail2ban Regex (pull_request) Successful in 40s
CI / Compose Bucket Idempotency (pull_request) Successful in 55s
toBeAttached() is not in the vitest-browser matcher set; toBeVisible() was previously ruled out because the spinner is 0x0 px. Mirror the querySelector pattern already used for the negative case in the same file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,14 +20,14 @@ const makeStatus = (overrides: Partial<ImportStatus> = {}): ImportStatus => ({
|
|||||||
|
|
||||||
describe('ImportStatusCard', () => {
|
describe('ImportStatusCard', () => {
|
||||||
it('shows spinner while state is RUNNING', async () => {
|
it('shows spinner while state is RUNNING', async () => {
|
||||||
const { getByTestId } = render(ImportStatusCard, {
|
render(ImportStatusCard, {
|
||||||
props: {
|
props: {
|
||||||
importStatus: makeStatus({ state: 'RUNNING', statusCode: 'IMPORT_RUNNING', processed: 3 }),
|
importStatus: makeStatus({ state: 'RUNNING', statusCode: 'IMPORT_RUNNING', processed: 3 }),
|
||||||
ontrigger: () => {}
|
ontrigger: () => {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await expect.element(getByTestId('spinner')).toBeAttached();
|
expect(document.querySelector('[data-testid="spinner"]')).not.toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows processed count at text-base while RUNNING', async () => {
|
it('shows processed count at text-base while RUNNING', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user