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

Che 16/subtask/create alumni directory page #38

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
2 changes: 0 additions & 2 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: build-tests
on:
pull_request:
branches:
- dev
jobs:
unit-testing:
runs-on: ubuntu-latest
Expand Down
31 changes: 31 additions & 0 deletions client/src/pages/DirectoryPage/DirectoryPage.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react";
import { create } from "react-test-renderer";
import { Provider } from "react-redux";
import configureStore from "redux-mock-store";

import DirectoryPage from "./DirectoryPage";

interface State {
user: {
userName: string;
};
}

const mockStore = configureStore<State>([]);
const initialState: State = {
user: {
userName: "TEST",
},
};

describe("MainPage Component", () => {
it("renders correctly", () => {
const store = mockStore(initialState);
const tree = create(
<Provider store={store}>
<DirectoryPage />
</Provider>
).toJSON();
expect(tree).toMatchSnapshot();
});
});
15 changes: 15 additions & 0 deletions client/src/pages/DirectoryPage/DirectoryPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import { useAppSelector } from "../../app/hooks";

const DirectoryPage = (): JSX.Element => {
const user = useAppSelector((state) => state.user.userData);

return (
<div className="min-h-screen bg-gray-100 flex flex-col items-center justify-center">
<h1 className="text-4xl font-extrabold mb-4">Directory Page</h1>
<h1>Welcome {user?.firstName} !</h1>
</div>
);
};

export default DirectoryPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`MainPage Component renders correctly 1`] = `
<div
className="min-h-screen bg-gray-100 flex flex-col items-center justify-center"
>
<h1
className="text-4xl font-extrabold mb-4"
>
Directory Page
</h1>
<h1>
Welcome
!
</h1>
</div>
`;