Skip to content
Open
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 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ jobs:
pkg-manager: yarn
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- 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
Comment on lines +58 to +68
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

- run:
name: Force install
command: yarn cypress install --force
Expand Down
23 changes: 16 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@
},
"parser": "@typescript-eslint/parser",
"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",
Comment on lines 10 to +26
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

"plugin:cypress/recommended",
"plugin:jest/recommended"
"plugin:jest/recommended",
"plugin:prettier/recommended"
],
"rules": {
// Your custom rules here
"linebreak-style": ["error", "unix"],
"require-atomic-updates": "off",
"react/jsx-uses-vars": 2,
Expand All @@ -42,11 +46,16 @@
"cypress/unsafe-to-chain-command": "warn",
"react/display-name": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"jest/no-focused-tests": "warn"
"jest/no-focused-tests": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"settings": {
"react": {
"version": "detect"
},
"next": {
"rootDir": ["./"]
}
}
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ cypress/results
.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

package-lock.json

.idea
12 changes: 9 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"semi": false,
"singleQuote": true,
"endOfLine": "auto",
"useTabs": false
}
"endOfLine": "lf",
"useTabs": false,
"bracketSpacing": true,
"bracketSameLine": false,
"singleAttributePerLine": true,
"printWidth": 80,
"tabWidth": 2

}
7 changes: 2 additions & 5 deletions __test__/_app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import { createRequest, createResponse } from 'node-mocks-http'
import jsonwebtoken from 'jsonwebtoken'
import * as HttpStatus from 'http-status-codes'

const {
HACKNEY_JWT_SECRET,
GSSO_TOKEN_NAME,
AGENTS_GOOGLE_GROUPNAME,
} = process.env
const { HACKNEY_JWT_SECRET, GSSO_TOKEN_NAME, AGENTS_GOOGLE_GROUPNAME } =
process.env

describe('MyApp.getInitialProps', () => {
describe('when the context contains a valid user token', () => {
Expand Down
12 changes: 4 additions & 8 deletions cypress/e2e/home-page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ describe('Home page', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
path: '/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
},
{
fixture: 'workOrders/workOrders.json',
Expand Down Expand Up @@ -104,8 +103,7 @@ describe('Home page', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
path: '/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
},
{
fixture: 'workOrders/workOrders.json',
Expand Down Expand Up @@ -174,8 +172,7 @@ describe('Home page', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
path: '/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
},
{
fixture: 'workOrders/workOrders.json',
Expand Down Expand Up @@ -247,8 +244,7 @@ describe('Home page', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
path: '/api/workOrders/?PageSize=10&PageNumber=1&IncludeHistorical=false',
},
{
fixture: 'workOrders/workOrders.json',
Expand Down
6 changes: 2 additions & 4 deletions cypress/e2e/property/boilerHouseFlag.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ describe('Boiler house flag', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
},
{ body: [] }
).as('workOrdersHistory')
Expand Down Expand Up @@ -39,8 +38,7 @@ describe('Boiler house flag', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
path: '/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
},
{
body: {
Expand Down
24 changes: 8 additions & 16 deletions cypress/e2e/property/show.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ describe('Show property', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
},
{ body: [] }
).as('workOrdersHistory')
Expand Down Expand Up @@ -44,8 +43,7 @@ describe('Show property', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
path: '/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
},
{
body: {
Expand Down Expand Up @@ -159,16 +157,14 @@ describe('Show property', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
},
{ body: properties }
)
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=2&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=2&sort=dateraised%3Adesc',
},
{
body: [
Expand Down Expand Up @@ -298,8 +294,7 @@ describe('Show property', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
},
{ body: workOrders }
).as('workOrder')
Expand Down Expand Up @@ -357,8 +352,7 @@ describe('Show property', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
},
{
body: [
Expand Down Expand Up @@ -481,8 +475,7 @@ describe('Show property', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
path: '/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
},
{
statusCode: 404,
Expand Down Expand Up @@ -579,8 +572,7 @@ describe('Show property', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
},
{ body: [] }
).as('workOrdersHistory')
Expand Down
6 changes: 2 additions & 4 deletions cypress/e2e/search/search.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ describe('Search', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders/?propertyReference=00012345&PageSize=50&PageNumber=1',
path: '/api/workOrders/?propertyReference=00012345&PageSize=50&PageNumber=1',
},
{ body: [] }
)
Expand Down Expand Up @@ -190,8 +189,7 @@ describe('Search', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
},
{ body: [] }
)
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/work-order/appointment/show.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ describe('Managing work order appointments', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1&sort=dateraised%3Adesc',
},
{ body: [] }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ describe('Closing my own work order - When follow-ons are enabled', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
path: '/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
},
{
body: {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/work-order/attend/close.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ describe('Closing my own work order', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
path: '/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
},
{
body: {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/work-order/attend/start.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ describe('Starting my own work order', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
path: '/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
},
{
body: {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/work-order/authorisation/authorisation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ describe('Authorisation workflow for a work order', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
},
{ body: [] }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ describe('Contract manager can authorise variation', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
},
{ body: [] }
).as('workOrdersRequest')
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/work-order/cancel.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ describe('Work order cancellations', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
path: '/api/workOrders?propertyReference=00012345&PageSize=50&PageNumber=1',
},
{ body: [] }
)
Expand Down
9 changes: 3 additions & 6 deletions cypress/e2e/work-order/create/appointment-form.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ describe('Schedule appointment form', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/schedule-of-rates/codes?tradeCode=PL&propertyReference=00012345&contractorReference=PUR&isRaisable=true',
path: '/api/schedule-of-rates/codes?tradeCode=PL&propertyReference=00012345&contractorReference=PUR&isRaisable=true',
},
{ fixture: 'scheduleOfRates/codesWithIsRaisableTrue.json' }
).as('sorCodes')
Expand Down Expand Up @@ -75,8 +74,7 @@ describe('Schedule appointment form', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/workOrders/?propertyReference=00012345&PageSize=50&PageNumber=1',
path: '/api/workOrders/?propertyReference=00012345&PageSize=50&PageNumber=1',
},
{ body: [] }
).as('workOrdersForProperty')
Expand All @@ -96,8 +94,7 @@ describe('Schedule appointment form', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
path: '/api/properties/4552c539-2e00-8533-078d-9cc59d9115da/person-alerts',
},
{
body: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,15 @@ describe('Raise repair form', () => {
cy.intercept(
{
method: 'GET',
path:
'/api/schedule-of-rates/check?tradeCode=PL&propertyReference=00012345&contractorReference=PUR&sorCode=ABCDEFGH&sorCode=00000001&sorCode=00000002&sorCode=ABCD1234&isRaisable=true',
path: '/api/schedule-of-rates/check?tradeCode=PL&propertyReference=00012345&contractorReference=PUR&sorCode=ABCDEFGH&sorCode=00000001&sorCode=00000002&sorCode=ABCD1234&isRaisable=true',
},
{ fixture: 'scheduleOfRates/firstMultipleSorCodesValidation.json' }
).as('firstValidation')

cy.intercept(
{
method: 'GET',
path:
'/api/schedule-of-rates/check?tradeCode=PL&propertyReference=00012345&contractorReference=PUR&sorCode=00000001&sorCode=00000002&sorCode=00000001&sorCode=00000002&sorCode=00000003&sorCode=00000004&sorCode=00000004&isRaisable=true',
path: '/api/schedule-of-rates/check?tradeCode=PL&propertyReference=00012345&contractorReference=PUR&sorCode=00000001&sorCode=00000002&sorCode=00000001&sorCode=00000002&sorCode=00000003&sorCode=00000004&sorCode=00000004&isRaisable=true',
},
{ fixture: 'scheduleOfRates/secondMultipleSorCodesValidation.json' }
).as('secondValidation')
Expand Down
Loading