Advertisement
Guest User

Untitled

a guest
Apr 11th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import { db } from '../../../firebase/clientTestFirebaseApps';
  2. describe('Notifications', () => {
  3. beforeAll(async () => {
  4. // Add the notification document to Firestore
  5. await addDoc(collection(await db, 'notifications'), {
  6. eventId: 1,
  7. groupId: 1,
  8. createdAt: new Date("2021-01-01"),
  9. eventImage: "image",
  10. groupImage: "test",
  11. groupName: "test",
  12. userId: 1,
  13. action: "Posted a new event"
  14. });
  15. });
  16.  
  17. it('should show the correct text', async () => {
  18. // Render the Notifications component
  19. await act(async () => {
  20. await render(
  21. <BrowserRouter>
  22. <Notifications />
  23. </BrowserRouter>,
  24. );
  25. });
  26.  
  27. // Check that the expected text is present in the rendered component
  28. expect(screen.getByText('Notifications')).toBeInTheDocument();
  29. expect(screen.getByText('Mark All Read')).toBeInTheDocument();
  30. });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement