-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
recruiter: add loading bar when downloading all resumes. (#47)
* add loading bar * run prettier * add resume disclaimer * fix message part 3 * fix tests * fix/add tests * fix tests part 17
- Loading branch information
1 parent
5205f02
commit 5828309
Showing
3 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
clientv2/src/components/AuthContext/ProgressLoadingScreen.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import { LoadingOverlay, Progress, useMantineColorScheme } from '@mantine/core'; | ||
|
||
interface ProgressFullScreenLoaderProps { | ||
totalItems: number; | ||
currentItems: number; | ||
title?: string; | ||
} | ||
|
||
const ProgressFullScreenLoader: React.FC<ProgressFullScreenLoaderProps> = ({ | ||
totalItems, | ||
currentItems, | ||
title, | ||
}) => { | ||
const { colorScheme } = useMantineColorScheme(); | ||
return ( | ||
<LoadingOverlay | ||
visible | ||
loaderProps={{ | ||
color: colorScheme === 'dark' ? 'white' : 'black', | ||
children: ( | ||
<> | ||
<h1>{title || 'Downloading...'}</h1> | ||
<Progress size="lg" radius="lg" value={(currentItems / totalItems) * 100} animated /> | ||
</> | ||
), | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default ProgressFullScreenLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,23 @@ describe("Test that users can edit their profile", () => { | |
expect(page.getByText('Skills')).toBeTruthy() | ||
expect(page.getByText('Botting')).toBeTruthy() | ||
await page.getByRole('button', { name: 'Edit' }).click(); | ||
try { | ||
const alreadyHasDegree = await page.getByText('Degree Level').isVisible(); | ||
if (!alreadyHasDegree) { | ||
await page.getByRole('button', { name: 'Add Degree' }).click(); | ||
await page.getByRole('textbox', { name: 'Major' }).click(); | ||
await page.getByRole('option', { name: 'Computer Science', exact: true }).click(); | ||
} catch (e) { | ||
console.log("user already has a degree, not adding another one.") | ||
} | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
expect(await page.waitForSelector('text="Profile saved!"')).toBeTruthy(); | ||
}); | ||
test('Profiles with no degrees fail to save', async ({ page, becomeUser }) => { | ||
await becomeUser(page, {email: '[email protected]', role: 'student'}) | ||
await page.getByRole('link', { name: 'My Profile' }).click(); | ||
expect(page.getByText('Resume Book User')).toBeTruthy() | ||
expect(page.getByText('Skills')).toBeTruthy() | ||
expect(page.getByText('Botting')).toBeTruthy() | ||
await page.getByRole('button', { name: 'Edit' }).click(); | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
expect(await page.waitForSelector('text="You must specify at least one degree."')).toBeTruthy(); | ||
}); | ||
}) |