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 { logout, login } from '../../support/index.js';
import { login, logout } from '../../support/index.js';
describe('Admin - Config Table Management', () => {
beforeEach('Loads page', () => {
logout();

View File

@ -1,5 +1,5 @@
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', () => {
beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
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', () => {
beforeEach('Loads page', () => {
logout();

View File

@ -1,5 +1,5 @@
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', () => {
beforeEach('Loads page', () => {

View File

@ -1,6 +1,6 @@
import * as configFunctions from '../../../helpers/functions.config.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', () => {
beforeEach('Loads page', () => {
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 { testAdmin } from '../../../test/_globals.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', () => {
beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
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', () => {
beforeEach('Loads page', () => {
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 { logout, login } from '../../support/index.js'
import { login, logout } from '../../support/index.js'
describe('Admin - Lot Type Management', () => {
beforeEach('Loads page', () => {

View File

@ -1,5 +1,5 @@
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', () => {
beforeEach('Loads page', () => {
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 { logout, login } from '../../support/index.js'
import { login, logout } from '../../support/index.js'
describe('Admin - Occupancy Type Management', () => {
beforeEach('Loads page', () => {

View File

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

View File

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

View File

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

View File

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

View File

@ -19,22 +19,30 @@ describe('Update - Maps', () => {
cy.checkA11y();
cy.log('Populate the fields');
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']")
.clear()
.type(mapJSON.mapDescription);
cy.get("input[name='mapAddress1']").clear().type(mapJSON.mapAddress1);
cy.get("input[name='mapAddress2']").clear().type(mapJSON.mapAddress2);
cy.get("input[name='mapPostalCode']").clear().type(mapJSON.mapPostalCode);
.type(mapJSON.mapDescription ?? '');
cy.get("input[name='mapAddress1']")
.clear()
.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']")
.clear()
.type(mapJSON.mapPhoneNumber);
.type(mapJSON.mapPhoneNumber ?? '');
cy.get("input[name='mapLatitude']")
.clear()
.type(mapJSON.mapLatitude.toString());
.type(mapJSON.mapLatitude?.toString() ?? '');
cy.get("input[name='mapLongitude']")
.clear()
.type(mapJSON.mapLongitude.toString());
.type(mapJSON.mapLongitude?.toString() ?? '');
});
cy.log('Ensure the default city and province are used');
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='mapPostalCode']").should('have.value', mapJSON.mapPostalCode);
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='mapLongitude']").should('have.value', mapJSON.mapLongitude.toString());
cy.get("input[name='mapLatitude']").should('have.value', mapJSON.mapLatitude?.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 { testUpdate } from '../../../test/_globals.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
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']")
.clear()
.type(mapJSON.mapDescription!)
.type(mapJSON.mapDescription ?? '')
cy.get("input[name='mapAddress1']").clear().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='mapAddress1']")
.clear()
.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']")
.clear()
.type(mapJSON.mapPhoneNumber!)
.type(mapJSON.mapPhoneNumber ?? '')
cy.get("input[name='mapLatitude']")
.clear()
.type(mapJSON.mapLatitude!.toString())
.type(mapJSON.mapLatitude?.toString() ?? '')
cy.get("input[name='mapLongitude']")
.clear()
.type(mapJSON.mapLongitude!.toString())
.type(mapJSON.mapLongitude?.toString() ?? '')
})
cy.log('Ensure the default city and province are used')
@ -111,11 +116,11 @@ describe('Update - Maps', () => {
cy.get("input[name='mapLatitude']").should(
'have.value',
mapJSON.mapLatitude!.toString()
mapJSON.mapLatitude?.toString()
)
cy.get("input[name='mapLongitude']").should(
'have.value',
mapJSON.mapLongitude!.toString()
mapJSON.mapLongitude?.toString()
)
})
})

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
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', () => {
beforeEach(() => {
logout();

View File

@ -1,6 +1,5 @@
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', () => {
beforeEach(() => {

View File

@ -1,5 +1,5 @@
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', () => {
beforeEach(() => {
logout();

View File

@ -1,6 +1,5 @@
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', () => {
beforeEach(() => {

View File

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