Skip to content

Conversation

@LBHCallumM
Copy link
Member

@LBHCallumM LBHCallumM commented Mar 27, 2025

@LBHCallumM LBHCallumM requested a review from a team as a code owner March 27, 2025 16:43
@LBHCallumM LBHCallumM changed the title Callum/upgrade next 13 Upgrade to next 13 Apr 11, 2025
Comment on lines +58 to +68
- 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
Copy link
Member Author

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

Comment on lines 10 to +26
"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",
Copy link
Member Author

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
Copy link
Member Author

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',
Copy link
Member Author

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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update packages ect

Comment on lines +73 to +74
it('closes the details panel after the enter key is pressed', async () => {
const user = userEvent.setup()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update test syntax

Comment on lines +77 to +79
const tenants = contacts?.filter?.((x) => x.tenureType === 'Tenant') ?? []
const householdMembers =
contacts?.filter?.((x) => x.tenureType === 'HouseholdMember') ?? []
Copy link
Member Author

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() }))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mock next router

Comment on lines 30 to 36
if (
formState.rateScheduleItems.length <
arrayOfRateScheduleItemComponentIndexes.length
formState?.rateScheduleItems &&
formState?.rateScheduleItems.length <
arrayOfRateScheduleItemComponentIndexes.length
) {
arrayOfRateScheduleItemComponentIndexes.pop()
}
Copy link
Member Author

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])
Copy link
Member Author

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

Comment on lines -104 to -109
await act(async () => {
await waitForElementToBeRemoved([
screen.getByTestId('spinner-locationAlerts'),
screen.getByTestId('spinner-personAlerts'),
])
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove old act syntax

Comment on lines +14 to 24
? '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>
Copy link
Member Author

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 () => {
Copy link
Member Author

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

Comment on lines +19 to +21
const onSubmit = async (e) => {
e.preventDefault()

Copy link
Member Author

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

Comment on lines +51 to 62
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] }
})
: []
)
Copy link
Member Author

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')
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants