Skip to content

Commit

Permalink
fixed eslint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
framitdavid committed Oct 29, 2024
1 parent 00190c1 commit dc28b90
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('useOrgAppScopedStorage', () => {
it.each(storagesToTest)(
'initializes ScopedStorageImpl with correct storage scope, %s',
(storage) => {
const result = renderUseOrgAppScopedStorage({ storage });
const { result } = renderUseOrgAppScopedStorage({ storage });

result.current.setItem('key', 'value');

Expand All @@ -32,7 +32,7 @@ describe('useOrgAppScopedStorage', () => {
);

it.each(storagesToTest)('should retrieve parsed objects from %s', (storage) => {
const result = renderUseOrgAppScopedStorage({ storage });
const { result } = renderUseOrgAppScopedStorage({ storage });

result.current.setItem('person', { name: 'John', age: 18 });

Expand All @@ -43,15 +43,15 @@ describe('useOrgAppScopedStorage', () => {
});

it.each(storagesToTest)('should be possible to remove item from %s', (storage) => {
const result = renderUseOrgAppScopedStorage({ storage });
const { result } = renderUseOrgAppScopedStorage({ storage });

result.current.setItem('key', 'value');
result.current.removeItem('key');
expect(result.current.getItem('key')).toBeUndefined();
});

it('should use localStorage as default storage', () => {
const result = renderUseOrgAppScopedStorage({});
const { result } = renderUseOrgAppScopedStorage({});
result.current.setItem('key', 'value');

expect(window.localStorage.getItem(scopedStorageKey)).toBe('{"key":"value"}');
Expand All @@ -65,5 +65,5 @@ const renderUseOrgAppScopedStorage = ({ storage }: UseOrgAppScopedStorage) => {
storage,
}),
);
return result;
return { result };
};

0 comments on commit dc28b90

Please sign in to comment.