Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusLevang committed Sep 6, 2024
1 parent b921849 commit dd74343
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 7 additions & 7 deletions __tests__/components/BoxRegistrationModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ test('Box registration has field for box id', () => {
});

test('Box registration has calendar for start date', () => {
expect(screen.getAllByText('1.')).toBeTruthy();
expect(screen.getAllByText('2.')).toBeTruthy();
expect(screen.getByText('9.')).toBeTruthy();
expect(screen.getByText('16.')).toBeTruthy();
expect(screen.getByText('21.')).toBeTruthy();
expect(screen.getByText('22.')).toBeTruthy();
expect(screen.getAllByText('28.')).toBeTruthy();
expect(screen.getAllByText('1')).toBeTruthy();
expect(screen.getAllByText('2')).toBeTruthy();
expect(screen.getByText('9')).toBeTruthy();
expect(screen.getByText('16')).toBeTruthy();
expect(screen.getByText('21')).toBeTruthy();
expect(screen.getByText('22')).toBeTruthy();
expect(screen.getAllByText('28')).toBeTruthy();
});

test('Box registration saves on button press', async () => {
Expand Down
8 changes: 8 additions & 0 deletions __tests__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ beforeAll(() => {
postNewIssuesForTitle: vi.fn(),
deleteIssue: vi.fn()
}));

const ResizeObserverMock = vi.fn(() => ({
observe: vi.fn(),
unobserve: vi.fn(),
disconnect: vi.fn(),
}));
vi.stubGlobal('ResizeObserver', ResizeObserverMock);
window.scrollTo = vi.fn();
});

afterEach(() => {
Expand Down

0 comments on commit dd74343

Please sign in to comment.