mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
23 lines
639 B
TypeScript
23 lines
639 B
TypeScript
import {TeamFixture} from 'sentry-fixture/team';
|
|
|
|
import {reactHooks} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import TeamStore from 'sentry/stores/teamStore';
|
|
import {useLegacyStore} from 'sentry/stores/useLegacyStore';
|
|
|
|
describe('useLegacyStore', () => {
|
|
const team = TeamFixture();
|
|
|
|
beforeEach(() => void TeamStore.reset());
|
|
|
|
it('should update on change to store', () => {
|
|
const {result} = reactHooks.renderHook(useLegacyStore, {initialProps: TeamStore});
|
|
|
|
expect(result.current.teams).toEqual([]);
|
|
|
|
reactHooks.act(() => TeamStore.loadInitialData([team]));
|
|
|
|
expect(result.current.teams).toEqual([team]);
|
|
});
|
|
});
|