Skip to content

Commit

Permalink
Merge branch 'feat/extend' of https://github.com/udecode/jotai-x into…
Browse files Browse the repository at this point in the history
… feat/extend
  • Loading branch information
12joan committed Dec 21, 2023
2 parents 56dcfc2 + 301380c commit d278211
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/jotai-x/src/createAtomStore.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,16 @@ describe('createAtomStore', () => {
expect(result.current).toBe('Jane is 98 years old');
});

it('includes extended atom in set hooks', () => {
const { result } = renderHook(() => Object.keys(useUserStore().set));
expect(result.current).toContain('bio');
});

it('includes extended atom in use hooks', () => {
const { result } = renderHook(() => Object.keys(useUserStore().use));
expect(result.current).toContain('bio');
});

it('computes extended atom based on current state', () => {
const { getByText } = render(
<UserProvider name="John" age={42}>
Expand Down

0 comments on commit d278211

Please sign in to comment.