Skip to content

Commit

Permalink
Improved reactive prop test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugos68 committed May 3, 2024
1 parent ab5714f commit 9f037e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/hooks/useInteractions/index.test.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ describe('useInteractions', () => {

const interactions = useInteractions([interaction]);

expect(interactions.getReferenceProps()).toHaveProperty('data-count');
expect(interactions.getReferenceProps()['data-count']).toBe(0);
const count = $derived(interactions.getReferenceProps()['data-count']);

expect(count).toBe(0);

reference['data-count'] = 1;

expect(interactions.getReferenceProps()['data-count']).toBe(1);
expect(count).toBe(1);
});
it('overrides duplicate non-eventlistener props with the latest interaction', () => {
const interactionOne: ElementProps = {
Expand Down

0 comments on commit 9f037e7

Please sign in to comment.