Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { db } from '../../../firebase/clientTestFirebaseApps';
- describe('Notifications', () => {
- beforeAll(async () => {
- // Add the notification document to Firestore
- await addDoc(collection(await db, 'notifications'), {
- eventId: 1,
- groupId: 1,
- createdAt: new Date("2021-01-01"),
- eventImage: "image",
- groupImage: "test",
- groupName: "test",
- userId: 1,
- action: "Posted a new event"
- });
- });
- it('should show the correct text', async () => {
- // Render the Notifications component
- await act(async () => {
- await render(
- <BrowserRouter>
- <Notifications />
- </BrowserRouter>,
- );
- });
- // Check that the expected text is present in the rendered component
- expect(screen.getByText('Notifications')).toBeInTheDocument();
- expect(screen.getByText('Mark All Read')).toBeInTheDocument();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement