|
1 | 1 | const puppeteer = require('puppeteer');
|
2 | 2 | const { filteredUsersData } = require('../../mock-data/users');
|
3 | 3 | const { mockUserData } = require('../../mock-data/users/mockdata');
|
4 |
| -const { getUsers } = require('../../users/discord/utils/util'); |
5 |
| -const { paginateFetchedUsers } = require('../../users/discord/App'); |
6 | 4 | const API_BASE_URL = 'https://staging-api.realdevsquad.com';
|
7 | 5 |
|
8 | 6 | describe('App Component', () => {
|
@@ -104,28 +102,6 @@ describe('App Component', () => {
|
104 | 102 | const url = await page.url();
|
105 | 103 | expect(url).toContain('?tab=verified');
|
106 | 104 | });
|
107 |
| - it('should fetch and append new users on subsequent pages for both tabs', async () => { |
108 |
| - // Mock the getUsers function to return full set of user data. |
109 |
| - jest.spyOn(global, getUsers).mockResolveValue([mockUserData]); |
110 |
| - |
111 |
| - // test in_discord tab |
112 |
| - await paginateFetchedUsers('in_discord', 1); |
113 |
| - expect(usersData['in_discord'].length).toBe(10); |
114 |
| - expect(currentPage).toBe(1); |
115 |
| - |
116 |
| - await paginateFetchedUsers('in_discord', 2); |
117 |
| - expect(usersData['in_discord'].length).toBe(20); |
118 |
| - expect(currentPage).toBe(2); |
119 |
| - |
120 |
| - // test verified tab |
121 |
| - await paginateFetchedUsers('verified', 1); |
122 |
| - expect(usersData['verified'].length).toBe(10); |
123 |
| - expect(currentPage).toBe(1); |
124 |
| - |
125 |
| - await paginateFetchedUsers('verified', 2); |
126 |
| - expect(usersData['verified'].length).toBe(20); |
127 |
| - expect(currentPage).toBe(2); |
128 |
| - }); |
129 | 105 |
|
130 | 106 | it('should handle user card clicks and apply active_tab class to clicked card only in discord tab', async () => {
|
131 | 107 | await page.goto(`${BASE_URL}/users/discord/?tab=in_discord`);
|
|
0 commit comments