code cleanup

deepsource-autofix-76c6eb20
Dan Gowans 2024-06-25 15:00:23 -04:00
parent 4115bdb8a5
commit a09fcfa82b
29 changed files with 62 additions and 69 deletions

View File

@ -1,5 +1,5 @@
import { testAdmin } from '../../../test/_globals.js'; import { testAdmin } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Admin - Config Table Management', () => { describe('Admin - Config Table Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {
logout(); logout();

View File

@ -1,5 +1,5 @@
import { testAdmin } from '../../../test/_globals.js' import { testAdmin } from '../../../test/_globals.js'
import { logout, login } from '../../support/index.js' import { login, logout } from '../../support/index.js'
describe('Admin - Config Table Management', () => { describe('Admin - Config Table Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
import { testAdmin } from '../../../test/_globals.js'; import { testAdmin } from '../../../test/_globals.js';
import { logout, login, ajaxDelayMillis } from '../../support/index.js'; import { ajaxDelayMillis, login, logout } from '../../support/index.js';
describe('Admin - Database Maintenance', () => { describe('Admin - Database Maintenance', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {
logout(); logout();

View File

@ -1,5 +1,5 @@
import { testAdmin } from '../../../test/_globals.js' import { testAdmin } from '../../../test/_globals.js'
import { logout, login, ajaxDelayMillis } from '../../support/index.js' import { ajaxDelayMillis, login, logout } from '../../support/index.js'
describe('Admin - Database Maintenance', () => { describe('Admin - Database Maintenance', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {

View File

@ -1,6 +1,6 @@
import * as configFunctions from '../../../helpers/functions.config.js'; import * as configFunctions from '../../../helpers/functions.config.js';
import { testAdmin } from '../../../test/_globals.js'; import { testAdmin } from '../../../test/_globals.js';
import { logout, login, ajaxDelayMillis } from '../../support/index.js'; import { ajaxDelayMillis, login, logout } from '../../support/index.js';
describe('Admin - Fee Management', () => { describe('Admin - Fee Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {
logout(); logout();

View File

@ -1,10 +1,7 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/no-non-null-assertion, promise/always-return, promise/catch-or-return */
import * as configFunctions from '../../../helpers/functions.config.js' import * as configFunctions from '../../../helpers/functions.config.js'
import { testAdmin } from '../../../test/_globals.js' import { testAdmin } from '../../../test/_globals.js'
import type { Fee } from '../../../types/recordTypes.js' import type { Fee } from '../../../types/recordTypes.js'
import { logout, login, ajaxDelayMillis } from '../../support/index.js' import { ajaxDelayMillis, login, logout } from '../../support/index.js'
describe('Admin - Fee Management', () => { describe('Admin - Fee Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
import { testAdmin } from '../../../test/_globals.js'; import { testAdmin } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Admin - Lot Type Management', () => { describe('Admin - Lot Type Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {
logout(); logout();

View File

@ -1,8 +1,5 @@
/* eslint-disable unicorn/filename-case, promise/catch-or-return, promise/always-return */
import { testAdmin } from '../../../test/_globals.js' import { testAdmin } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Admin - Lot Type Management', () => { describe('Admin - Lot Type Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
import { testAdmin } from '../../../test/_globals.js'; import { testAdmin } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Admin - Occupancy Type Management', () => { describe('Admin - Occupancy Type Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {
logout(); logout();

View File

@ -1,8 +1,5 @@
/* eslint-disable unicorn/filename-case, promise/catch-or-return, promise/always-return */
import { testAdmin } from '../../../test/_globals.js' import { testAdmin } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Admin - Occupancy Type Management', () => { describe('Admin - Occupancy Type Management', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
import { testUpdate } from '../../../test/_globals.js'; import { testUpdate } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Update - Lot Occupancies', () => { describe('Update - Lot Occupancies', () => {
beforeEach(() => { beforeEach(() => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testUpdate } from '../../../test/_globals.js' import { testUpdate } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Update - Lot Occupancies', () => { describe('Update - Lot Occupancies', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -1,5 +1,5 @@
import { testUpdate } from '../../../test/_globals.js'; import { testUpdate } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Update - Lots', () => { describe('Update - Lots', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testUpdate } from '../../../test/_globals.js' import { testUpdate } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Update - Lots', () => { describe('Update - Lots', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {

View File

@ -19,22 +19,30 @@ describe('Update - Maps', () => {
cy.checkA11y(); cy.checkA11y();
cy.log('Populate the fields'); cy.log('Populate the fields');
cy.fixture('map.json').then((mapJSON) => { cy.fixture('map.json').then((mapJSON) => {
cy.get("input[name='mapName']").clear().type(mapJSON.mapName); cy.get("input[name='mapName']")
.clear()
.type(mapJSON.mapName ?? '');
cy.get("textarea[name='mapDescription']") cy.get("textarea[name='mapDescription']")
.clear() .clear()
.type(mapJSON.mapDescription); .type(mapJSON.mapDescription ?? '');
cy.get("input[name='mapAddress1']").clear().type(mapJSON.mapAddress1); cy.get("input[name='mapAddress1']")
cy.get("input[name='mapAddress2']").clear().type(mapJSON.mapAddress2); .clear()
cy.get("input[name='mapPostalCode']").clear().type(mapJSON.mapPostalCode); .type(mapJSON.mapAddress1 ?? '');
cy.get("input[name='mapAddress2']")
.clear()
.type(mapJSON.mapAddress2 ?? '');
cy.get("input[name='mapPostalCode']")
.clear()
.type(mapJSON.mapPostalCode ?? '');
cy.get("input[name='mapPhoneNumber']") cy.get("input[name='mapPhoneNumber']")
.clear() .clear()
.type(mapJSON.mapPhoneNumber); .type(mapJSON.mapPhoneNumber ?? '');
cy.get("input[name='mapLatitude']") cy.get("input[name='mapLatitude']")
.clear() .clear()
.type(mapJSON.mapLatitude.toString()); .type(mapJSON.mapLatitude?.toString() ?? '');
cy.get("input[name='mapLongitude']") cy.get("input[name='mapLongitude']")
.clear() .clear()
.type(mapJSON.mapLongitude.toString()); .type(mapJSON.mapLongitude?.toString() ?? '');
}); });
cy.log('Ensure the default city and province are used'); cy.log('Ensure the default city and province are used');
cy.get("input[name='mapCity']").should('have.value', getConfigProperty('settings.map.mapCityDefault')); cy.get("input[name='mapCity']").should('have.value', getConfigProperty('settings.map.mapCityDefault'));
@ -54,8 +62,8 @@ describe('Update - Maps', () => {
cy.get("input[name='mapProvince']").should('have.value', getConfigProperty('settings.map.mapProvinceDefault')); cy.get("input[name='mapProvince']").should('have.value', getConfigProperty('settings.map.mapProvinceDefault'));
cy.get("input[name='mapPostalCode']").should('have.value', mapJSON.mapPostalCode); cy.get("input[name='mapPostalCode']").should('have.value', mapJSON.mapPostalCode);
cy.get("input[name='mapPhoneNumber']").should('have.value', mapJSON.mapPhoneNumber); cy.get("input[name='mapPhoneNumber']").should('have.value', mapJSON.mapPhoneNumber);
cy.get("input[name='mapLatitude']").should('have.value', mapJSON.mapLatitude.toString()); cy.get("input[name='mapLatitude']").should('have.value', mapJSON.mapLatitude?.toString());
cy.get("input[name='mapLongitude']").should('have.value', mapJSON.mapLongitude.toString()); cy.get("input[name='mapLongitude']").should('have.value', mapJSON.mapLongitude?.toString());
}); });
}); });
}); });

View File

@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { getConfigProperty } from '../../../helpers/functions.config.js' import { getConfigProperty } from '../../../helpers/functions.config.js'
import { testUpdate } from '../../../test/_globals.js' import { testUpdate } from '../../../test/_globals.js'
import type { MapRecord } from '../../../types/recordTypes.js' import type { MapRecord } from '../../../types/recordTypes.js'
@ -32,24 +29,32 @@ describe('Update - Maps', () => {
// eslint-disable-next-line promise/catch-or-return, promise/always-return // eslint-disable-next-line promise/catch-or-return, promise/always-return
cy.fixture('map.json').then((mapJSON: MapRecord) => { cy.fixture('map.json').then((mapJSON: MapRecord) => {
cy.get("input[name='mapName']").clear().type(mapJSON.mapName!) cy.get("input[name='mapName']")
.clear()
.type(mapJSON.mapName ?? '')
cy.get("textarea[name='mapDescription']") cy.get("textarea[name='mapDescription']")
.clear() .clear()
.type(mapJSON.mapDescription!) .type(mapJSON.mapDescription ?? '')
cy.get("input[name='mapAddress1']").clear().type(mapJSON.mapAddress1!) cy.get("input[name='mapAddress1']")
cy.get("input[name='mapAddress2']").clear().type(mapJSON.mapAddress2!) .clear()
cy.get("input[name='mapPostalCode']").clear().type(mapJSON.mapPostalCode!) .type(mapJSON.mapAddress1 ?? '')
cy.get("input[name='mapAddress2']")
.clear()
.type(mapJSON.mapAddress2 ?? '')
cy.get("input[name='mapPostalCode']")
.clear()
.type(mapJSON.mapPostalCode ?? '')
cy.get("input[name='mapPhoneNumber']") cy.get("input[name='mapPhoneNumber']")
.clear() .clear()
.type(mapJSON.mapPhoneNumber!) .type(mapJSON.mapPhoneNumber ?? '')
cy.get("input[name='mapLatitude']") cy.get("input[name='mapLatitude']")
.clear() .clear()
.type(mapJSON.mapLatitude!.toString()) .type(mapJSON.mapLatitude?.toString() ?? '')
cy.get("input[name='mapLongitude']") cy.get("input[name='mapLongitude']")
.clear() .clear()
.type(mapJSON.mapLongitude!.toString()) .type(mapJSON.mapLongitude?.toString() ?? '')
}) })
cy.log('Ensure the default city and province are used') cy.log('Ensure the default city and province are used')
@ -111,11 +116,11 @@ describe('Update - Maps', () => {
cy.get("input[name='mapLatitude']").should( cy.get("input[name='mapLatitude']").should(
'have.value', 'have.value',
mapJSON.mapLatitude!.toString() mapJSON.mapLatitude?.toString()
) )
cy.get("input[name='mapLongitude']").should( cy.get("input[name='mapLongitude']").should(
'have.value', 'have.value',
mapJSON.mapLongitude!.toString() mapJSON.mapLongitude?.toString()
) )
}) })
}) })

View File

@ -1,5 +1,5 @@
import { testUpdate } from '../../../test/_globals.js'; import { testUpdate } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Update User', () => { describe('Update User', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testUpdate } from '../../../test/_globals.js' import { testUpdate } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Update User', () => { describe('Update User', () => {
beforeEach('Loads page', () => { beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
import { testUpdate } from '../../../test/_globals.js'; import { testUpdate } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Update - Work Orders', () => { describe('Update - Work Orders', () => {
beforeEach(() => { beforeEach(() => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testUpdate } from '../../../test/_globals.js' import { testUpdate } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Update - Work Orders', () => { describe('Update - Work Orders', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -1,5 +1,5 @@
import { testView } from '../../../test/_globals.js'; import { testView } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Read Only User', () => { describe('Read Only User', () => {
beforeEach(() => { beforeEach(() => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testView } from '../../../test/_globals.js' import { testView } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Read Only User', () => { describe('Read Only User', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -1,5 +1,5 @@
import { testView } from '../../../test/_globals.js'; import { testView } from '../../../test/_globals.js';
import { logout, login, ajaxDelayMillis } from '../../support/index.js'; import { ajaxDelayMillis, login, logout } from '../../support/index.js';
describe('Reports', () => { describe('Reports', () => {
beforeEach(() => { beforeEach(() => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testView } from '../../../test/_globals.js' import { testView } from '../../../test/_globals.js'
import { ajaxDelayMillis, login, logout } from '../../support/index.js'
import { logout, login, ajaxDelayMillis } from '../../support/index.js'
describe('Reports', () => { describe('Reports', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -1,5 +1,5 @@
import { testView } from '../../../test/_globals.js'; import { testView } from '../../../test/_globals.js';
import { logout, login, ajaxDelayMillis } from '../../support/index.js'; import { ajaxDelayMillis, login, logout } from '../../support/index.js';
describe('Work Order Milestone Calendar', () => { describe('Work Order Milestone Calendar', () => {
beforeEach(() => { beforeEach(() => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testView } from '../../../test/_globals.js' import { testView } from '../../../test/_globals.js'
import { ajaxDelayMillis, login, logout } from '../../support/index.js'
import { logout, login, ajaxDelayMillis } from '../../support/index.js'
describe('Work Order Milestone Calendar', () => { describe('Work Order Milestone Calendar', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -1,5 +1,5 @@
import { testView } from '../../../test/_globals.js'; import { testView } from '../../../test/_globals.js';
import { logout, login } from '../../support/index.js'; import { login, logout } from '../../support/index.js';
describe('Work Order Outlook Integration', () => { describe('Work Order Outlook Integration', () => {
beforeEach(() => { beforeEach(() => {
logout(); logout();

View File

@ -1,6 +1,5 @@
import { testView } from '../../../test/_globals.js' import { testView } from '../../../test/_globals.js'
import { login, logout } from '../../support/index.js'
import { logout, login } from '../../support/index.js'
describe('Work Order Outlook Integration', () => { describe('Work Order Outlook Integration', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -1,6 +1,3 @@
/* eslint-disable promise/always-return */
/* eslint-disable promise/catch-or-return */
describe('Keep Alive', () => { describe('Keep Alive', () => {
it('Returns true', () => { it('Returns true', () => {
cy.request('/keepAlive').then((response) => { cy.request('/keepAlive').then((response) => {