-
Notifications
You must be signed in to change notification settings - Fork 1
Upgrade to next 13 #1027
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
base: develop
Are you sure you want to change the base?
Upgrade to next 13 #1027
Conversation
| - run: | ||
| name: Install Xvfb | ||
| command: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y xvfb libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 | ||
| - run: | ||
| name: Start Xvfb | ||
| command: | | ||
| Xvfb :99 -screen 0 1280x1024x24 & | ||
| echo "export DISPLAY=:99" >> $BASH_ENV | ||
| background: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this is needed for cypress to run well in circleci
| "parserOptions": { | ||
| "ecmaVersion": 2020, | ||
| "ecmaVersion": 2022, | ||
| "sourceType": "module", | ||
| "ecmaFeatures": { | ||
| "jsx": true | ||
| } | ||
| }, | ||
| "plugins": ["react", "@typescript-eslint"], | ||
| "plugins": [ | ||
| "react", | ||
| "react-hooks", | ||
| "@typescript-eslint" | ||
| ], | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:react/recommended", | ||
| "plugin:prettier/recommended", | ||
| "plugin:react-hooks/recommended", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates to eslint
| .sentryclirc | ||
|
|
||
| # Version control | ||
| yarn.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added yarn.lock back to vc, we should really be deploying with the same versions
| let reporterRules = require('./reporter-rules.json') | ||
|
|
||
| module.exports = { | ||
| testEnvironment: 'jsdom', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update test config
| "loglevel": "^1.8.0", | ||
| "mockdate": "^3.0.2", | ||
| "next": "^12", | ||
| "next": "13", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update packages ect
| it('closes the details panel after the enter key is pressed', async () => { | ||
| const user = userEvent.setup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update test syntax
| const tenants = contacts?.filter?.((x) => x.tenureType === 'Tenant') ?? [] | ||
| const householdMembers = | ||
| contacts?.filter?.((x) => x.tenureType === 'HouseholdMember') ?? [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle null
|
|
||
| const axios = require('axios') | ||
|
|
||
| jest.mock('next/router', () => ({ useRouter: jest.fn() })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mock next router
| if ( | ||
| formState.rateScheduleItems.length < | ||
| arrayOfRateScheduleItemComponentIndexes.length | ||
| formState?.rateScheduleItems && | ||
| formState?.rateScheduleItems.length < | ||
| arrayOfRateScheduleItemComponentIndexes.length | ||
| ) { | ||
| arrayOfRateScheduleItemComponentIndexes.pop() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix bug when rateScheduleItems is null
| } | ||
| } | ||
| }, arrayOfRateScheduleItemComponentIndexes) | ||
| }, [arrayOfRateScheduleItemComponentIndexes]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did this ever work without a dependency array
| await act(async () => { | ||
| await waitForElementToBeRemoved([ | ||
| screen.getByTestId('spinner-locationAlerts'), | ||
| screen.getByTestId('spinner-personAlerts'), | ||
| ]) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove old act syntax
| ? 'Reschedule appointment (non DRS)' | ||
| : 'Schedule appointment (non DRS)' | ||
|
|
||
| return ( | ||
| <> | ||
| <Link href={href}> | ||
| <a className="lbh-link">{linkText} (non DRS)</a> | ||
| <Link | ||
| href={href} | ||
| className="lbh-link" | ||
| > | ||
| {linkText} | ||
| </Link> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move (non DRS) to linkText
| setLoading(false) | ||
| } | ||
|
|
||
| useEffect(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix useEffect by moving async logic into a function
| const onSubmit = async (e) => { | ||
| e.preventDefault() | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent form from reloading page within cypress tests
| const onGetToSummary = (data) => { | ||
| updateExistingTasksQuantities(data, tasks) | ||
|
|
||
| setAddedTasks( | ||
| e.rateScheduleItems | ||
| ? e.rateScheduleItems | ||
| .filter((e) => e != null) | ||
| .map((e, index) => { | ||
| return { id: index, ...e, code: e.code.split(' - ')[0] } | ||
| data.rateScheduleItems | ||
| ? data.rateScheduleItems | ||
| .filter((data) => data != null) | ||
| .map((data, index) => { | ||
| return { id: index, ...data, code: data.code.split(' - ')[0] } | ||
| }) | ||
| : [] | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data, not e
| @@ -1,4 +1,4 @@ | |||
| import { v4 as uuidv4 } from 'uuid' | |||
| const { v4: uuidv4 } = require('uuid') | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eslint doesnt like this package due to MJS (no recent updates). The options were to replace the package, or change the import syntax
https://nextjs.org/docs/pages/building-your-application/upgrading/version-13
https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor