From 195bc9deb902424c39a4761882b3135c6aa022e1 Mon Sep 17 00:00:00 2001 From: unional Date: Sat, 11 Jan 2025 00:18:59 -0800 Subject: [PATCH] test: fix global options test --- testcases/vpv/src/to_match_image_snapshot.spec.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testcases/vpv/src/to_match_image_snapshot.spec.tsx b/testcases/vpv/src/to_match_image_snapshot.spec.tsx index 960e9de0..fa105fb1 100644 --- a/testcases/vpv/src/to_match_image_snapshot.spec.tsx +++ b/testcases/vpv/src/to_match_image_snapshot.spec.tsx @@ -29,12 +29,14 @@ it('take snapshot of the whole body', async () => { it('uses options set in vis()', async () => { setAutoSnapshotOptions(false) const hasSnapshot = await page.hasImageSnapshot({ customizeSnapshotId: (id) => id }) - const screen = page.render(
{hasSnapshot ? 'hello' : 'world'}
) + const screen = page.render(
hello
) const subject = screen.getByTestId('subject') - if (hasSnapshot) { - await expect(subject).toMatchImageSnapshot() + if (!hasSnapshot) { + await expect(subject).toMatchImageSnapshot({ customizeSnapshotId: (id) => id }) } + subject.element().innerHTML = 'world' + await expect(subject) .toMatchImageSnapshot({ expectToFail: true,