From 65fcc32c9604d3226bb2f954cd77813ec65b3133 Mon Sep 17 00:00:00 2001 From: Joseph Dvorak Date: Mon, 12 Jun 2023 22:26:04 -0700 Subject: [PATCH] #217 Migrate Footer (#222) * set up next.js environment and add workflows * testing that branch protection rule works when jest tests fail * updated ci test script to use -u flag * testing that failed tests prevent pushing * retesting branch protection rule * testing that lack of code coverage causes push to fail * testing that successful tests allow the push * testing failing tests * all tests should now pass * added .env* to gitignore * added header, user model, and user context * split links into separate components for each user type and activeUser state * updated header to leverage react context api * created header context, completed header, hamburger menu, signout modal and popup modal * added unit tests for header and related components * add footer, minor styling updates to page container, home page --- .../__snapshots__/footer.snapshot.tsx.snap | 82 +++++++++++++++++++ .../components/footer/footer.snapshot.tsx | 11 +++ .../components/footer/footer.spec.tsx | 53 ++++++++++++ .../__snapshots__/header.snapshot.tsx.snap | 4 +- .../components/header/icons-tray.spec.tsx | 1 - src/components/footer/footer.tsx | 56 +++++++++++++ src/components/page-container.tsx | 2 +- src/components/utils/popup-modal.tsx | 22 ++--- src/pages/_app.tsx | 16 ++-- src/pages/privacy-policy.tsx | 0 src/pages/terms-of-service.tsx | 0 .../components/footer/footer.module.scss | 39 +++++++++ .../components/page-container.module.scss | 16 ---- .../utils/page-container.module.scss | 5 +- src/styles/modules/pages/home.module.scss | 1 - 15 files changed, 265 insertions(+), 43 deletions(-) create mode 100644 src/__tests__/components/footer/__snapshots__/footer.snapshot.tsx.snap create mode 100644 src/__tests__/components/footer/footer.snapshot.tsx create mode 100644 src/__tests__/components/footer/footer.spec.tsx create mode 100644 src/components/footer/footer.tsx create mode 100644 src/pages/privacy-policy.tsx create mode 100644 src/pages/terms-of-service.tsx create mode 100644 src/styles/modules/components/footer/footer.module.scss delete mode 100644 src/styles/modules/components/page-container.module.scss diff --git a/src/__tests__/components/footer/__snapshots__/footer.snapshot.tsx.snap b/src/__tests__/components/footer/__snapshots__/footer.snapshot.tsx.snap new file mode 100644 index 00000000..83dd78ee --- /dev/null +++ b/src/__tests__/components/footer/__snapshots__/footer.snapshot.tsx.snap @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Footer renders the Footer unchanged. 1`] = ` +
+ +
+`; diff --git a/src/__tests__/components/footer/footer.snapshot.tsx b/src/__tests__/components/footer/footer.snapshot.tsx new file mode 100644 index 00000000..8d3e01c5 --- /dev/null +++ b/src/__tests__/components/footer/footer.snapshot.tsx @@ -0,0 +1,11 @@ +import {render, cleanup} from '@testing-library/react'; +import '@testing-library/jest-dom'; +import Footer from '@/components/footer/footer'; + +describe('Footer', () => { + afterEach(cleanup); + it('renders the Footer unchanged.', () => { + const { container } = render(