Skip to content

Commit 1a2b13a

Browse files
authored
Merge pull request #892 from Real-Dev-Squad/develop
Dev To Main Sync
2 parents 021f7c4 + 2e83ff6 commit 1a2b13a

File tree

14 files changed

+515
-92
lines changed

14 files changed

+515
-92
lines changed

__tests__/applications/applications.test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,35 @@ describe('Applications page', () => {
295295
);
296296
await page.waitForNetworkIdle();
297297
});
298+
299+
it('should display the footer with the correct repo link', async () => {
300+
const footer = await page.$('[data-test-id="footer"]');
301+
expect(footer).toBeTruthy();
302+
303+
const infoRepo = await footer.$('[data-test-id="info-repo"]');
304+
expect(infoRepo).toBeTruthy();
305+
306+
const repoLink = await infoRepo.$('[data-test-id="repo-link"]');
307+
expect(repoLink).toBeTruthy();
308+
309+
const repoLinkHref = await page.evaluate((el) => el.href, repoLink);
310+
expect(repoLinkHref).toBe(
311+
'https://github.com/Real-Dev-Squad/website-dashboard',
312+
);
313+
314+
const repoLinkTarget = await page.evaluate((el) => el.target, repoLink);
315+
expect(repoLinkTarget).toBe('_blank');
316+
317+
const repoLinkRel = await page.evaluate((el) => el.rel, repoLink);
318+
expect(repoLinkRel).toBe('noopener noreferrer');
319+
320+
const repoLinkText = await page.evaluate((el) => el.innerText, repoLink);
321+
expect(repoLinkText).toBe('open sourced repo');
322+
323+
const repoLinkClass = await page.evaluate((el) => el.className, repoLink);
324+
expect(repoLinkClass).toBe('');
325+
326+
const repoLinkStyle = await page.evaluate((el) => el.style, repoLink);
327+
expect(repoLinkStyle).toBeTruthy();
328+
});
298329
});

__tests__/extension-requests/extension-requests.test.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,106 @@ describe('Tests the Extension Requests Screen', () => {
640640
expect(cardCount === 3 || cardCount === 7).toBe(true);
641641
});
642642

643+
it('checks whether the shimmer effect is visible under dev flag only for the assignee image element', async () => {
644+
await page.goto(`${baseUrl}/?dev=true`);
645+
const assignImageSelector = await page.$$(
646+
'[data-testid="assignee-image skeleton"]',
647+
);
648+
expect(assignImageSelector).toBeTruthy();
649+
650+
await page.waitForTimeout(5000);
651+
const hasSkeletonClassAfter = await page.$eval('.assignee-image', (el) =>
652+
el.classList.contains('skeleton'),
653+
);
654+
expect(hasSkeletonClassAfter).toBe(false);
655+
});
656+
657+
it('checks whether the shimmer effect is visible under dev flag only for the assignee name element', async () => {
658+
await page.goto(`${baseUrl}/?dev=true`);
659+
const assignNameSelector = await page.$$(
660+
'[data-testid="assignee-name skeleton-text"]',
661+
);
662+
expect(assignNameSelector).toBeTruthy();
663+
await page.waitForTimeout(5000);
664+
const hasSkeletonClassAfter = await page.$eval('.assignee-name', (el) =>
665+
el.classList.contains('skeleton-text'),
666+
);
667+
expect(hasSkeletonClassAfter).toBe(false);
668+
});
669+
670+
it('checks whether the shimmer effect is working for deadlineValue element under feature flag', async () => {
671+
await page.goto(`${baseUrl}/?dev=true`);
672+
const deadlineValueSelector = await page.$$(
673+
'[data-testid="skeleton-span"]',
674+
);
675+
expect(deadlineValueSelector).toBeTruthy();
676+
await page.waitForTimeout(5000);
677+
const hasSkeletonClassAfter = await page.$eval('.tooltip-container', (el) =>
678+
el.classList.contains('skeleton-span'),
679+
);
680+
expect(hasSkeletonClassAfter).toBe(false);
681+
});
682+
683+
it('checks whether the shimmer effect is working for requestedValue element under feature flag', async () => {
684+
await page.goto(`${baseUrl}/?dev=true`);
685+
const requestedValueSelector = await page.$$(
686+
'[data-testid="skeleton-text"]',
687+
);
688+
expect(requestedValueSelector).toBeTruthy();
689+
await page.waitForTimeout(5000);
690+
const hasSkeletonClassAfter = await page.$eval('.requested-day', (el) =>
691+
el.classList.contains('skeleton-text'),
692+
);
693+
expect(hasSkeletonClassAfter).toBe(false);
694+
});
695+
it('checks whether the shimmer effect is working for newDeadlineValue element under feature flag', async () => {
696+
await page.goto(`${baseUrl}/?dev=true`);
697+
const newDeadlineValueSelector = await page.$$(
698+
'[data-testid="skeleton-span"]',
699+
);
700+
expect(newDeadlineValueSelector).toBeTruthy();
701+
await page.waitForTimeout(5000);
702+
const hasSkeletonClassAfter = await page.$eval('.requested-day', (el) =>
703+
el.classList.contains('skeleton-span'),
704+
);
705+
expect(hasSkeletonClassAfter).toBe(false);
706+
});
707+
708+
it('checks whether the shimmer effect is working for extensionRequestNumberValue element under feature flag', async () => {
709+
await page.goto(`${baseUrl}/?dev=true`);
710+
const extensionRequestNumberValueSelector = await page.$$(
711+
'[data-testid="skeleton-span"]',
712+
);
713+
expect(extensionRequestNumberValueSelector).toBeTruthy();
714+
await page.waitForTimeout(5000);
715+
const hasSkeletonClassAfter = await page.$eval(
716+
'.extension-request-number',
717+
(el) => el.classList.contains('skeleton-span'),
718+
);
719+
expect(hasSkeletonClassAfter).toBe(false);
720+
});
721+
722+
it('checks whether the shimmer effect is visible under dev flag only for the statusSiteLink element', async () => {
723+
await page.goto(`${baseUrl}/?dev=true`);
724+
const statusSiteLinkSelector = await page.$$(
725+
'[data-testid="external-link skeleton-link"]',
726+
);
727+
expect(statusSiteLinkSelector).toBeTruthy();
728+
await page.waitForTimeout(5000);
729+
const hasSkeletonClassAfter = await page.$eval('.external-link', (el) =>
730+
el.classList.contains('skeleton-link'),
731+
);
732+
expect(hasSkeletonClassAfter).toBe(false);
733+
});
734+
735+
it('checks whether the shimmer effect is visible under dev flag only for the taskStatusValue element', async () => {
736+
await page.goto(`${baseUrl}/?dev=true`);
737+
const taskStatusValueElement = await page.$$(
738+
'[data-testid="skeleton-span"]',
739+
);
740+
expect(taskStatusValueElement).toBeTruthy();
741+
});
742+
643743
it('Checks whether the card is not removed from display when api call is unsuccessful', async () => {
644744
const extensionCards = await page.$$('.extension-card');
645745

__tests__/groups/group.test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,35 @@ describe('Discord Groups Page', () => {
266266

267267
expect(noGroupDiv).toBeTruthy();
268268
});
269+
270+
it('should display the footer with the correct repo link', async () => {
271+
const footer = await page.$('[data-test-id="footer"]');
272+
expect(footer).toBeTruthy();
273+
274+
const infoRepo = await footer.$('[data-test-id="info-repo"]');
275+
expect(infoRepo).toBeTruthy();
276+
277+
const repoLink = await infoRepo.$('[data-test-id="repo-link"]');
278+
expect(repoLink).toBeTruthy();
279+
280+
const repoLinkHref = await page.evaluate((el) => el.href, repoLink);
281+
expect(repoLinkHref).toBe(
282+
'https://github.com/Real-Dev-Squad/website-dashboard',
283+
);
284+
285+
const repoLinkTarget = await page.evaluate((el) => el.target, repoLink);
286+
expect(repoLinkTarget).toBe('_blank');
287+
288+
const repoLinkRel = await page.evaluate((el) => el.rel, repoLink);
289+
expect(repoLinkRel).toBe('noopener noreferrer');
290+
291+
const repoLinkText = await page.evaluate((el) => el.innerText, repoLink);
292+
expect(repoLinkText).toBe('open sourced repo');
293+
294+
const repoLinkClass = await page.evaluate((el) => el.className, repoLink);
295+
expect(repoLinkClass).toBe('');
296+
297+
const repoLinkStyle = await page.evaluate((el) => el.style, repoLink);
298+
expect(repoLinkStyle).toBeTruthy();
299+
});
269300
});

__tests__/users/App.test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const API_BASE_URL = 'https://staging-api.realdevsquad.com';
66
describe('App Component', () => {
77
let browser;
88
let page;
9-
jest.setTimeout(60000);
9+
jest.setTimeout(90000);
1010
let config = {
1111
launchOptions: {
1212
headless: 'new',
@@ -68,6 +68,11 @@ describe('App Component', () => {
6868
});
6969

7070
it('should render all sections', async () => {
71+
await page.waitForSelector('.tabs_section');
72+
await page.waitForSelector('.users_section');
73+
await page.waitForSelector('.user_card');
74+
await page.waitForSelector('.user_details_section');
75+
7176
let tabsSection = await page.$('.tabs_section');
7277
let usersSection = await page.$('.users_section');
7378
let firstUser = await page.$('.user_card');
@@ -82,6 +87,8 @@ describe('App Component', () => {
8287
});
8388

8489
it('should update the URL query string and re-render the app', async () => {
90+
await page.waitForSelector('[data_key="verified"]');
91+
8592
// Click on the "Linked Accounts" tab
8693
await page.click('[data_key="verified"]');
8794

applications/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<link rel="stylesheet" href="/applications/style.css" />
7+
<link rel="stylesheet" href="../global.css" />
78
<script type="module" src="/applications/script.js" defer></script>
89
<script src="/helpers/loadENV.js"></script>
910
<title>Applications</title>
@@ -121,5 +122,11 @@ <h2>Status</h2>
121122
<div class="loader hidden">Loading...</div>
122123
<div id="page_bottom_element"></div>
123124
</div>
125+
<script>
126+
document.addEventListener('DOMContentLoaded', () => {
127+
loadFooter();
128+
});
129+
</script>
130+
<script src="../footer/footerComponent.js"></script>
124131
</body>
125132
</html>

0 commit comments

Comments
 (0)