Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

202405 UI update #514

Merged
merged 5 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11,831 changes: 42 additions & 11,789 deletions functions/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"main": "lib/src/index.js",
"dependencies": {
"@vikelabs/uvic-course-scraper": "^1.0.0-alpha.8",
"@vikelabs/uvic-course-scraper": "^1.0.0-alpha.10",
"async": "^3.2.1",
"express": "^4.17.2",
"firebase-admin": "^10.0.1",
Expand Down
4 changes: 3 additions & 1 deletion functions/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export type Term =
| '202301'
| '202305'
| '202309'
| '202401';
| '202401'
| '202405';

// make const array of terms from above
export const terms: Term[] = [
Expand All @@ -29,6 +30,7 @@ export const terms: Term[] = [
'202305',
'202309',
'202401',
'202405',
];

// add some code?
Expand Down
2 changes: 1 addition & 1 deletion src/common/header/components/TermSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useDarkMode } from 'lib/hooks/useDarkMode';
import { useTerm } from 'lib/hooks/useTerm';
import { getReadableTerm } from 'lib/utils/terms';

const terms = ['202305', '202309', '202401'];
const terms = ['202309', '202401', '202405'];

export function TermSelect(): JSX.Element {
const { subject } = useParams();
Expand Down
14 changes: 7 additions & 7 deletions src/common/header/components/__tests__/TermSelect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ describe('TermSelect', () => {
render(<TermSelect />);
const termSelect = screen.getByRole('combobox') as HTMLSelectElement;

expect(termSelect.value).toStrictEqual('202305');
expect(termSelect.value).toStrictEqual('202309');
});

it('should navigate to the selected term', () => {
render(<TermSelect />);
const termSelect = screen.getByRole('combobox') as HTMLSelectElement;

const summerOption = screen.getAllByRole('option')[0];
userEvent.selectOptions(termSelect, summerOption);
expect(mockNavigate).toBeCalledWith('/calendar/202305');

const fallOption = screen.getAllByRole('option')[1];
const fallOption = screen.getAllByRole('option')[0];
userEvent.selectOptions(termSelect, fallOption);
expect(mockNavigate).toBeCalledWith('/calendar/202309');

const springOption = screen.getAllByRole('option')[2];
const springOption = screen.getAllByRole('option')[1];
userEvent.selectOptions(termSelect, springOption);
expect(mockNavigate).toBeCalledWith('/calendar/202401');

const summerOption = screen.getAllByRole('option')[2];
userEvent.selectOptions(termSelect, summerOption);
expect(mockNavigate).toBeCalledWith('/calendar/202405');
});
});
10 changes: 3 additions & 7 deletions src/common/header/containers/HeaderContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,10 @@ export function HeaderContainer({ onSearchChange }: HeaderProps): JSX.Element {
: [
<Text>
📅 The{' '}
<Text as={Link} to="/calendar/202309" textDecoration="underline">
Fall 2023
<Text as={Link} to="/calendar/202405" textDecoration="underline">
Summer 2024
</Text>{' '}
and{' '}
<Text as={Link} to="/calendar/202401" textDecoration="underline">
Spring 2024
</Text>{' '}
calendars are now available. Happy scheduling!
calendar is now available. Happy scheduling!
</Text>,
];
return (
Expand Down
3 changes: 2 additions & 1 deletion src/lib/fetchers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export type Term =
| '202301'
| '202305'
| '202309'
| '202401';
| '202401'
| '202405';

export interface NestedPreCoRequisites {
reqList?: (NestedPreCoRequisites | KualiCourse | string)[];
Expand Down
6 changes: 3 additions & 3 deletions src/pages/calendar/components/__tests__/Requisites.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const reqNested = {

describe('DisplayRequirement', () => {
it('should render the string requirement', () => {
mockUseSessionStorage.mockReturnValue(['202305', mockSetTerm]);
mockUseSessionStorage.mockReturnValue(['202309', mockSetTerm]);
render(DisplayRequirement(reqString, 1));
expect(screen.getByTitle('Requisite')).toHaveTextContent('with a minimum GPA of 3.0 over all courses');
});

it('should render the course requirement', () => {
mockUseSessionStorage.mockReturnValue(['202305', mockSetTerm]);
mockUseSessionStorage.mockReturnValue(['202309', mockSetTerm]);
render(
DisplayRequirement(
{
Expand All @@ -42,7 +42,7 @@ describe('DisplayRequirement', () => {
});

it('should render the nested requirement', () => {
mockUseSessionStorage.mockReturnValue(['202305', mockSetTerm]);
mockUseSessionStorage.mockReturnValue(['202309', mockSetTerm]);
render(DisplayRequirement(reqNested, 1));
expect(screen.getByTitle(`${reqNested.reqList[0].subject} ${reqNested.reqList[0].code}`)).toHaveTextContent(
'PHYS 111'
Expand Down
Loading