mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
import {TeamFixture} from 'sentry-fixture/team';
|
|
|
|
import {act, render} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import TeamStore from 'sentry/stores/teamStore';
|
|
import Teams from 'sentry/utils/teams';
|
|
|
|
describe('utils.teams', function () {
|
|
const renderer = jest.fn(() => null);
|
|
|
|
beforeEach(function () {
|
|
TeamStore.loadInitialData([
|
|
TeamFixture({id: '1', slug: 'bar'}),
|
|
TeamFixture({id: '2', slug: 'foo'}),
|
|
]);
|
|
renderer.mockClear();
|
|
});
|
|
|
|
afterEach(function () {
|
|
act(() => void TeamStore.loadInitialData([]));
|
|
});
|
|
|
|
it('sends projects to children', function () {
|
|
render(<Teams>{renderer}</Teams>);
|
|
|
|
expect(renderer).toHaveBeenCalledWith(
|
|
expect.objectContaining({
|
|
fetching: false,
|
|
hasMore: null,
|
|
fetchError: null,
|
|
teams: [
|
|
expect.objectContaining({
|
|
id: '1',
|
|
slug: 'bar',
|
|
}),
|
|
expect.objectContaining({
|
|
id: '2',
|
|
slug: 'foo',
|
|
}),
|
|
],
|
|
})
|
|
);
|
|
});
|
|
});
|