Commit 6d41cb24 authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

feat(ProfileType): First profileType created by user acts as default

parent 06db2d08
......@@ -35,14 +35,14 @@ jest.mock('./ecogesture.service', () => {
describe('Action Service', () => {
const actionService = new ActionService(mockClient)
it('shoud return the default actions', async () => {
it('should return the default actions', async () => {
mockgetAllEcogestures.mockResolvedValueOnce(AllEcogestureData)
mockgetEcogesturesByIds.mockResolvedValueOnce(defaultEcogestureData)
const result: Ecogesture[] = await actionService.getDefaultActions()
expect(result).toEqual(defaultEcogestureData)
})
it('shoud return the Available Action List', async () => {
it('should return the Available Action List', async () => {
mockgetAllUserChallengeEntities.mockResolvedValueOnce(userChallengeData)
mockgetAllEcogestures.mockResolvedValueOnce(AllEcogestureData)
mockgetEcogesturesByIds.mockResolvedValueOnce([
......@@ -58,7 +58,7 @@ describe('Action Service', () => {
AllEcogestureData[4],
])
})
it('shoud return winter ecogestures', () => {
it('should return winter ecogestures', () => {
jest.spyOn(utils, 'getSeason').mockReturnValueOnce(Season.WINTER)
const result: Ecogesture[] = actionService.filterBySeason(AllEcogestureData)
expect(result).toEqual([
......@@ -67,13 +67,13 @@ describe('Action Service', () => {
AllEcogestureData[5],
])
})
it('shoud return no season ecogestures', () => {
it('should return no season ecogestures', () => {
jest.spyOn(utils, 'getSeason').mockReturnValueOnce(Season.NONE)
const result: Ecogesture[] = actionService.filterBySeason(AllEcogestureData)
expect(result).toEqual([AllEcogestureData[3], AllEcogestureData[4]])
})
it('shoud return summer ecogestures', () => {
it('should return summer ecogestures', () => {
jest.spyOn(utils, 'getSeason').mockReturnValueOnce(Season.SUMMER)
const result: Ecogesture[] = actionService.filterBySeason(AllEcogestureData)
......@@ -84,7 +84,7 @@ describe('Action Service', () => {
])
})
it('shoud launch an action', () => {
it('should launch an action', () => {
jest
.spyOn(DateTime, 'local')
.mockReturnValueOnce(
......@@ -119,7 +119,7 @@ describe('Action Service', () => {
})
describe('getCustomActions function', () => {
it('shoud return filtered and sorted ecogestures and not complete the list', async () => {
it('should return filtered and sorted ecogestures and not complete the list', async () => {
jest.spyOn(utils, 'getSeason').mockReturnValueOnce(Season.WINTER)
mockgetAllUserChallengeEntities.mockResolvedValueOnce(userChallengeData)
mockgetAllEcogestures.mockResolvedValueOnce(AllEcogestureData)
......@@ -139,7 +139,7 @@ describe('Action Service', () => {
AllEcogestureData[2],
])
})
it('shoud return filtered and sorted ecogestures and complete the list with default ecogesture', async () => {
it('should return filtered and sorted ecogestures and complete the list with default ecogesture', async () => {
jest.spyOn(utils, 'getSeason').mockReturnValueOnce(Season.WINTER)
mockgetAllUserChallengeEntities.mockResolvedValueOnce(userChallengeData)
mockgetAllEcogestures.mockResolvedValueOnce(AllEcogestureData)
......
......@@ -35,7 +35,7 @@ describe('Connection service', () => {
const connectionService = new ConnectionService(mockClient)
describe('connectNewUser method', () => {
it('shoud return created Trigger', async () => {
it('should return created Trigger', async () => {
mockGetKonnector.mockResolvedValueOnce(konnectorsData[0])
mockCreateAccount.mockResolvedValueOnce(accountsData[0])
mockCreateTrigger.mockResolvedValueOnce(triggersData[0])
......@@ -48,7 +48,7 @@ describe('Connection service', () => {
expect(result).toEqual(mockResult)
})
it('shoud throw error when konnector is not found', async () => {
it('should throw error when konnector is not found', async () => {
let error
try {
await connectionService.connectNewUser(
......@@ -64,7 +64,7 @@ describe('Connection service', () => {
)
})
it('shoud throw error when account is not created', async () => {
it('should throw error when account is not created', async () => {
mockGetKonnector.mockResolvedValueOnce(konnectorsData[0])
let error
try {
......@@ -79,7 +79,7 @@ describe('Connection service', () => {
expect(error).toEqual(new Error(`Error during account creation`))
})
it('shoud throw error when trigger is not created', async () => {
it('should throw error when trigger is not created', async () => {
mockGetKonnector.mockResolvedValueOnce(konnectorsData[0])
mockCreateAccount.mockResolvedValueOnce(accountsData[0])
let error
......
......@@ -66,7 +66,7 @@ describe('Consumption service', () => {
)
expect(result).toBeNull()
})
it('shoud return a mapped data for one fluid', async () => {
it('should return a mapped data for one fluid', async () => {
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataActual)
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataComparison)
const mockResult = {
......@@ -241,7 +241,7 @@ describe('Consumption service', () => {
})
})
describe('getMaxLoad method', () => {
it('shoud return the maxed value for a time period for the home', async () => {
it('should return the maxed value for a time period for the home', async () => {
for (let i = 0; i < fluidTypes.length; i++) {
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataActual)
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataComparison)
......@@ -256,7 +256,7 @@ describe('Consumption service', () => {
)
expect(result).toEqual(expectedResult)
})
it('shoud return the maxed value for a time period', async () => {
it('should return the maxed value for a time period', async () => {
const mockFluidTypes = [1]
const expectedResult = 63.1254
mockFetchFluidMaxData.mockResolvedValueOnce(expectedResult)
......@@ -271,7 +271,7 @@ describe('Consumption service', () => {
})
})
describe('getPerformanceIndicators method', () => {
it('shoud return the performance indicator', async () => {
it('should return the performance indicator', async () => {
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataActual)
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataComparison)
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataActual)
......@@ -321,7 +321,7 @@ describe('Consumption service', () => {
})
})
describe('fetchLastDateData method', () => {
it('shoud return the latest date data of one fluid', async () => {
it('should return the latest date data of one fluid', async () => {
const mockFluidTypes = [0]
const expectedResult = DateTime.fromISO('2020-09-03T23:59:59.999Z')
mockGetLastDateData.mockResolvedValueOnce(
......@@ -332,7 +332,7 @@ describe('Consumption service', () => {
)
expect(result).toEqual(expectedResult)
})
it('shoud return the latest date data of multiple fluid', async () => {
it('should return the latest date data of multiple fluid', async () => {
const mockFluidTypes = [0, 2]
mockGetLastDateData.mockResolvedValueOnce(
DateTime.fromISO('2020-09-03T23:59:59.999Z')
......@@ -346,7 +346,7 @@ describe('Consumption service', () => {
)
expect(result).toEqual(expectedResult)
})
it('shoud return the latest date data of all fluids', async () => {
it('should return the latest date data of all fluids', async () => {
mockGetLastDateData.mockResolvedValueOnce(
DateTime.fromISO('2020-09-02T23:59:59.999Z')
)
......@@ -365,7 +365,7 @@ describe('Consumption service', () => {
})
})
describe('fetchAllLastDateData method', () => {
it('shoud return the latest date data of one fluid', async () => {
it('should return the latest date data of one fluid', async () => {
const mockFluidTypes = [0]
const expectedResult = [DateTime.fromISO('2020-09-03T23:59:59.999Z')]
mockGetLastDateData.mockResolvedValueOnce(
......@@ -376,7 +376,7 @@ describe('Consumption service', () => {
)
expect(result).toEqual(expectedResult)
})
it('shoud return the latest date data of All fluid', async () => {
it('should return the latest date data of All fluid', async () => {
mockGetLastDateData.mockResolvedValueOnce(
DateTime.fromISO('2020-09-02T23:59:59.999Z')
)
......@@ -398,7 +398,7 @@ describe('Consumption service', () => {
})
})
describe('checkDoctypeEntries method', () => {
it('shoud return a boolean if doctype are correct', async () => {
it('should return a boolean if doctype are correct', async () => {
let fluidType = 2
mockGetEntries.mockResolvedValueOnce({ data: [1] })
let result = await consumptionDataManager.checkDoctypeEntries(
......
......@@ -59,7 +59,7 @@ const unknowTimeStep = 999
describe('ConsumptionFormatter service', () => {
const consumptionFormatterService = new ConsumptionFormatterService()
describe('formatGraphData method', () => {
it('shoud return a formattedData for DAY', () => {
it('should return a formattedData for DAY', () => {
const mockResult = [
{
date: DateTime.fromISO('2020-10-01T00:00:00.000Z', {
......@@ -90,7 +90,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toEqual(mockResult)
})
it('shoud return a formattedData for HALF_AN_HOUR', () => {
it('should return a formattedData for HALF_AN_HOUR', () => {
mockTimePeriod = {
startDate: DateTime.fromISO('2020-10-01T00:00:00.000Z', {
zone: 'utc',
......@@ -130,7 +130,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toEqual(mockResult)
})
it('shoud return a formattedData for MONTH', () => {
it('should return a formattedData for MONTH', () => {
mockTimePeriod = {
startDate: DateTime.fromISO('2020-10-01T00:00:00.000Z', {
zone: 'utc',
......@@ -170,7 +170,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toEqual(mockResult)
})
it('shoud return a formattedData for YEAR', () => {
it('should return a formattedData for YEAR', () => {
mockTimePeriod = {
startDate: DateTime.fromISO('2018-10-01T00:00:00.000Z', {
zone: 'utc',
......@@ -210,7 +210,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toEqual(mockResult)
})
it('shoud return an error because of unknown TimeStep', () => {
it('should return an error because of unknown TimeStep', () => {
try {
consumptionFormatterService.formatGraphData(
mockDataLoad,
......
......@@ -16,7 +16,7 @@ let fluidTypes: FluidType[] = [0, 1, 2]
describe('ConsumptionFormatter service', () => {
const consumptionValidatorService = new ConsumptionValidatorService()
describe('formatGraphData method', () => {
it('shoud return true for DAY', () => {
it('should return true for DAY', () => {
const result = consumptionValidatorService.ValidateGetGraphData(
mockTimePeriod,
TimeStep.DAY,
......@@ -24,7 +24,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeTruthy()
})
it('shoud return true with comparison Date', () => {
it('should return true with comparison Date', () => {
const result = consumptionValidatorService.ValidateGetGraphData(
mockTimePeriod,
TimeStep.DAY,
......@@ -33,7 +33,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeTruthy()
})
it('shoud return false with comparison Date', () => {
it('should return false with comparison Date', () => {
const wrongTimePeriodComparison: TimePeriod = {
startDate: DateTime.fromISO('2020-09-05T00:00:00.000Z', {
zone: 'utc',
......@@ -48,7 +48,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false with comparison Date', () => {
it('should return false with comparison Date', () => {
const wrongTimePeriodComparison: TimePeriod = {
startDate: DateTime.fromISO('2020-09-05T00:00:00.000Z', {
zone: 'utc',
......@@ -63,7 +63,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of fluid', () => {
it('should return false because of fluid', () => {
const wrongFluidType: FluidType[] = []
const result = consumptionValidatorService.ValidateGetGraphData(
mockTimePeriod,
......@@ -72,7 +72,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of wrong TimePeriod', () => {
it('should return false because of wrong TimePeriod', () => {
const wrongTimePeriod: TimePeriod = {
startDate: DateTime.fromISO('2020-10-05T00:00:00.000Z', {
zone: 'utc',
......@@ -86,7 +86,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of HALF_AN_HOUR and ELECTRICITY', () => {
it('should return false because of HALF_AN_HOUR and ELECTRICITY', () => {
const result = consumptionValidatorService.ValidateGetGraphData(
mockTimePeriod,
TimeStep.HALF_AN_HOUR,
......@@ -94,7 +94,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of HALF_AN_HOUR and ValidateTimePeriodLength', () => {
it('should return false because of HALF_AN_HOUR and ValidateTimePeriodLength', () => {
fluidTypes = [0] //Only fluid without TimeStep incompatibilty
const mockTimePeriodTooLong: TimePeriod = {
startDate: DateTime.fromISO('2020-10-01T00:00:00.000Z', {
......@@ -109,7 +109,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of WEEK and ValidateTimePeriodLength', () => {
it('should return false because of WEEK and ValidateTimePeriodLength', () => {
const mockTimePeriodTooLong: TimePeriod = {
startDate: DateTime.fromISO('2020-10-01T00:00:00.000Z', {
zone: 'utc',
......@@ -123,7 +123,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of DAY and ValidateTimePeriodLength', () => {
it('should return false because of DAY and ValidateTimePeriodLength', () => {
const mockTimePeriodTooLong: TimePeriod = {
startDate: DateTime.fromISO('2020-10-01T00:00:00.000Z', {
zone: 'utc',
......@@ -137,7 +137,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of MONTH and ValidateTimePeriodLength', () => {
it('should return false because of MONTH and ValidateTimePeriodLength', () => {
const mockTimePeriodTooLong: TimePeriod = {
startDate: DateTime.fromISO('2018-10-01T00:00:00.000Z', {
zone: 'utc',
......@@ -151,7 +151,7 @@ describe('ConsumptionFormatter service', () => {
)
expect(result).toBeFalsy()
})
it('shoud return false because of YEAR and ValidateTimePeriodLength', () => {
it('should return false because of YEAR and ValidateTimePeriodLength', () => {
const mockTimePeriodTooLong: TimePeriod = {
startDate: DateTime.fromISO('2009-10-01T00:00:00.000Z', {
zone: 'utc',
......
......@@ -8,32 +8,32 @@ describe('Converter service', () => {
describe('LoadToEuro method', () => {
const fluidConfig = configService.getFluidConfig()
it('shoud return the load to euro for Electricity', () => {
it('should return the load to euro for Electricity', () => {
const expectedConversion =
20 * fluidConfig[FluidType.ELECTRICITY].coefficient
const result = converterService.LoadToEuro(20, FluidType.ELECTRICITY)
expect(result).toEqual(expectedConversion)
})
it('shoud return the load to euro for Gas', () => {
it('should return the load to euro for Gas', () => {
const expectedConversion = 20 * fluidConfig[FluidType.GAS].coefficient
const result = converterService.LoadToEuro(20, FluidType.GAS)
expect(result).toEqual(expectedConversion)
})
it('shoud return the load to euro for Water', () => {
it('should return the load to euro for Water', () => {
const expectedConversion = 20 * fluidConfig[FluidType.WATER].coefficient
const result = converterService.LoadToEuro(20, FluidType.WATER)
expect(result).toEqual(expectedConversion)
})
it('shoud return the load to euro for Multifluid, no coeff apply', () => {
it('should return the load to euro for Multifluid, no coeff apply', () => {
const expectedConversion = 20
const result = converterService.LoadToEuro(20, FluidType.MULTIFLUID)
expect(result).toEqual(expectedConversion)
})
it('shoud return 0.01 if the load is below 0.01 euro', () => {
it('should return 0.01 if the load is below 0.01 euro', () => {
const expectedConversion = 0.01
const result = converterService.LoadToEuro(0.002, FluidType.WATER)
expect(result).toEqual(expectedConversion)
......
......@@ -20,7 +20,7 @@ describe('Ecogesture service', () => {
const ecogestureService = new EcogestureService(mockClient)
describe('getAllEcogestures', () => {
it('shoud return all ecogestures', async () => {
it('should return all ecogestures', async () => {
const mockQueryResult: QueryResult<Ecogesture[]> = {
data: ecogesturesData,
bookmark: '',
......@@ -31,7 +31,7 @@ describe('Ecogesture service', () => {
const result = await ecogestureService.getAllEcogestures()
expect(result).toEqual(ecogesturesData)
})
it('shoud return empty array when no ecogestures stored', async () => {
it('should return empty array when no ecogestures stored', async () => {
const mockQueryResult: QueryResult<Ecogesture[]> = {
data: [],
bookmark: '',
......@@ -45,7 +45,7 @@ describe('Ecogesture service', () => {
})
describe('deleteAllEcogestures', () => {
it('shoud return true when 3 ecogestures stored', async () => {
it('should return true when 3 ecogestures stored', async () => {
const mockQueryResult: QueryResult<Ecogesture[]> = {
data: ecogesturesData,
bookmark: '',
......@@ -57,7 +57,7 @@ describe('Ecogesture service', () => {
expect(mockClient.destroy).toBeCalledTimes(3)
expect(result).toBe(true)
})
it('shoud return true when no ecogestures stored', async () => {
it('should return true when no ecogestures stored', async () => {
const mockQueryResult: QueryResult<Ecogesture[]> = {
data: [],
bookmark: '',
......@@ -68,7 +68,7 @@ describe('Ecogesture service', () => {
const result = await ecogestureService.deleteAllEcogestures()
expect(result).toBe(true)
})
it('shoud return false when error happened on deletion', async () => {
it('should return false when error happened on deletion', async () => {
const mockQueryResult: QueryResult<Ecogesture[]> = {
data: ecogesturesData,
bookmark: '',
......@@ -84,7 +84,7 @@ describe('Ecogesture service', () => {
describe('filteredEcogestureList', () => {
describe('usage heating', () => {
it('shoud return ecogesture with electricity', async () => {
it('should return ecogesture with electricity', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesHeatingData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -97,7 +97,7 @@ describe('Ecogesture service', () => {
)
expect(result).toEqual([mockEcogestureList[0], mockEcogestureList[2]])
})
it('shoud return ecogesture with gas', async () => {
it('should return ecogesture with gas', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesHeatingData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -110,7 +110,7 @@ describe('Ecogesture service', () => {
)
expect(result).toEqual([mockEcogestureList[1], mockEcogestureList[2]])
})
it('shoud not return ecogesture when profile heating is collective', async () => {
it('should not return ecogesture when profile heating is collective', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesHeatingData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -126,7 +126,7 @@ describe('Ecogesture service', () => {
})
describe('usage ECS', () => {
it('shoud return ecogesture with electricity', async () => {
it('should return ecogesture with electricity', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesECSData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -139,7 +139,7 @@ describe('Ecogesture service', () => {
)
expect(result).toEqual([mockEcogestureList[0], mockEcogestureList[2]])
})
it('shoud return ecogesture with gas', async () => {
it('should return ecogesture with gas', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesECSData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -152,7 +152,7 @@ describe('Ecogesture service', () => {
)
expect(result).toEqual([mockEcogestureList[1], mockEcogestureList[2]])
})
it('shoud not return ecogesture when profile warming is collective', async () => {
it('should not return ecogesture when profile warming is collective', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesECSData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -168,7 +168,7 @@ describe('Ecogesture service', () => {
})
describe('usage COOKING', () => {
it('shoud return ecogesture with electricity', async () => {
it('should return ecogesture with electricity', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesCookingData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -180,7 +180,7 @@ describe('Ecogesture service', () => {
)
expect(result).toEqual([mockEcogestureList[0], mockEcogestureList[2]])
})
it('shoud return ecogesture with gas', async () => {
it('should return ecogesture with gas', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesCookingData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -195,7 +195,7 @@ describe('Ecogesture service', () => {
})
describe('usage COLD_WATER', () => {
it('shoud return all water ecogestures', async () => {
it('should return all water ecogestures', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesColdWaterData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -207,7 +207,7 @@ describe('Ecogesture service', () => {
)
expect(result).toEqual(mockEcogestureList)
})
it('shoud not return water ecogestures', async () => {
it('should not return water ecogestures', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesColdWaterData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -222,7 +222,7 @@ describe('Ecogesture service', () => {
})
describe('usage ELECTRICITY_SPECIFIC', () => {
it('shoud return all ecogestures', async () => {
it('should return all ecogestures', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesElecSpecificData
const mockProfileType: ProfileType = {
...profileData.profileType,
......@@ -236,7 +236,7 @@ describe('Ecogesture service', () => {
})
describe('usage AIR_CONDITIONING', () => {
it('shoud not return ecogestures', async () => {
it('should not return ecogestures', async () => {
const mockEcogestureList: Ecogesture[] = ecogesturesAirConditioningData
const mockProfileType: ProfileType = {
...profileData.profileType,
......
......@@ -57,7 +57,7 @@ describe('FLuid service', () => {
})
describe('getFluidStatus method', () => {
it('shoud return fluid status for all fluids', async () => {
it('should return fluid status for all fluids', async () => {
const mockLastDataDates: (DateTime | null)[] = [
DateTime.local().setZone('utc', {
keepLocalTime: true,
......@@ -150,7 +150,7 @@ describe('FLuid service', () => {
expect(result).toEqual(mockResult)
})
it('shoud return fluid status with NOT_CONNECTED status when no accounts', async () => {
it('should return fluid status with NOT_CONNECTED status when no accounts', async () => {
const mockLastDataDates: (DateTime | null)[] = [
DateTime.local().setZone('utc', {
keepLocalTime: true,
......@@ -243,7 +243,7 @@ describe('FLuid service', () => {
expect(result).toEqual(mockResult)
})
it('shoud return fluid status with KONNECTOR_NOT_FOUND status when no konnector', async () => {
it('should return fluid status with KONNECTOR_NOT_FOUND status when no konnector', async () => {
const mockLastDataDates: (DateTime | null)[] = [
DateTime.local().setZone('utc', {
keepLocalTime: true,
......@@ -336,7 +336,7 @@ describe('FLuid service', () => {
expect(result).toEqual(mockResult)
})
it('shoud return fluid status with NOT_CONNECTED status when no triggers', async () => {
it('should return fluid status with NOT_CONNECTED status when no triggers', async () => {
const mockLastDataDates: (DateTime | null)[] = [
DateTime.local().setZone('utc', {
keepLocalTime: true,
......@@ -429,7 +429,7 @@ describe('FLuid service', () => {
expect(result).toEqual(mockResult)
})
it('shoud return fluid status with null laste date for water and gaz', async () => {
it('should return fluid status with null laste date for water and gaz', async () => {
const mockLastDataDates: (DateTime | null)[] = [
DateTime.local(),
null,
......@@ -521,7 +521,7 @@ describe('FLuid service', () => {
})
describe('getOldFluidData method', () => {
it('shoud return Electricity as old fluid', async () => {
it('should return Electricity as old fluid', async () => {
const mockFluidStatus: FluidStatus[] = [
{
fluidType: FluidType.ELECTRICITY,
......@@ -552,7 +552,7 @@ describe('FLuid service', () => {
expect(result).toEqual([FluidType.ELECTRICITY])
})
it('shoud return empty array as lastdatadate < 5 days', async () => {
it('should return empty array as lastdatadate < 5 days', async () => {
const mockFluidStatus: FluidStatus[] = [
{
fluidType: FluidType.ELECTRICITY,
......@@ -585,7 +585,7 @@ describe('FLuid service', () => {
expect(result).toEqual([])
})
it('shoud return empty array as status is NOT_CONNECTED', async () => {
it('should return empty array as status is NOT_CONNECTED', async () => {
const mockFluidStatus: FluidStatus[] = [
{
fluidType: FluidType.ELECTRICITY,
......@@ -616,7 +616,7 @@ describe('FLuid service', () => {
expect(result).toEqual([])
})
it('shoud return empty array as status is KONNECTOR_NOT_FOUND', async () => {
it('should return empty array as status is KONNECTOR_NOT_FOUND', async () => {
const mockFluidStatus: FluidStatus[] = [
{
fluidType: FluidType.ELECTRICITY,
......@@ -647,7 +647,7 @@ describe('FLuid service', () => {
expect(result).toEqual([])