Skip to content

Commit

Permalink
test: fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Aug 29, 2023
1 parent 64d7ac1 commit 59cc096
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ exports[`Watermark MutationObserver should work properly 1`] = `
<div
class="watermark"
style="position: relative;"
/>
>
<div
style="z-index: 9; position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; background-repeat: repeat; background-position: 0px 0px; background-image: url('data:image/png;base64,00'); background-size: 229px;"
/>
</div>
</div>
`;

Expand All @@ -55,7 +59,7 @@ exports[`Watermark Observe the modification of style 1`] = `
style="position: relative;"
>
<div
style=""
style="z-index: 9; position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; background-repeat: repeat; background-position: -250px -250px; background-image: url('data:image/png;base64,00'); background-size: 229px;"
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions components/watermark/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Watermark', () => {
const target = container.querySelector<HTMLDivElement>('.watermark div');
await waitFakeTimer();
target?.remove();
await waitFor(() => expect(target).toBeTruthy());
await waitFakeTimer();
expect(container).toMatchSnapshot();
});

Expand All @@ -102,7 +102,7 @@ describe('Watermark', () => {
const target = container.querySelector<HTMLDivElement>('.watermark div');
await waitFakeTimer();
target?.setAttribute('style', '');
await waitFor(() => expect(target).toBeTruthy());
await waitFakeTimer();
expect(container).toMatchSnapshot();
});

Expand Down

0 comments on commit 59cc096

Please sign in to comment.