Skip to content

Commit

Permalink
Add Test to Tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Apr 4, 2024
1 parent a1dbffc commit 4d08370
Show file tree
Hide file tree
Showing 4 changed files with 1,160 additions and 1,145 deletions.
2 changes: 1 addition & 1 deletion src/__test__/__mockStore__/useMockBountyData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { bountyResponse } from '__test__/__mockData__/bounty';
import { useEffect } from 'react';
import { useStores } from 'store';
import { transformBountyWithPeopleBounty } from 'store/__test__/util';
import { transformBountyWithPeopleBounty } from 'store/__tests__/util';

export const useMockBountyData = ({ enabled }: { enabled: boolean }) => {
const { main } = useStores();
Expand Down
15 changes: 15 additions & 0 deletions src/pages/tickets/__tests__/Tickets.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,21 @@ describe('Tickets Component', () => {
})();
});

it('Test that a newly created bounty is visible.', async () => {
render(<Tickets />);

(async () => {
await waitFor(() => {
expect(screen.queryByTestId('tickets-component')).toBeInTheDocument();
});

// Check if bounties are rendered
mockBounties.forEach(({ bounty }) => {
expect(screen.getByText(`bounty title: ${bounty.title}`)).toBeInTheDocument();
});
})();
});

it('tests that out of connection code is displayed when there are no codes', () => {
uiStore.setMeInfo(null);

Expand Down
Loading

0 comments on commit 4d08370

Please sign in to comment.