diff --git a/core/src/components/datetime/test/data.spec.ts b/core/src/components/datetime/test/data.spec.ts index e557f2c03a..6a577c7db3 100644 --- a/core/src/components/datetime/test/data.spec.ts +++ b/core/src/components/datetime/test/data.spec.ts @@ -257,5 +257,35 @@ describe('generateTime()', () => { expect(minutes.length).toEqual(60); }); }); + + it('should respect the min & max bounds', () => { + const refValue = { + day: undefined, + month: undefined, + year: undefined, + hour: 20, + minute: 30 + } + + const minParts = { + day: undefined, + month: undefined, + year: undefined, + hour: 19, + minute: 30 + } + + const maxParts = { + day: undefined, + month: undefined, + year: undefined, + hour: 20, + minute: 40 + }; + + const { hours } = generateTime(refValue, 'h23', minParts, maxParts); + + expect(hours).toStrictEqual([19, 20]); + }); }) }) diff --git a/core/src/components/datetime/test/minmax/index.html b/core/src/components/datetime/test/minmax/index.html index 3a92d412e6..fbba64a03a 100644 --- a/core/src/components/datetime/test/minmax/index.html +++ b/core/src/components/datetime/test/minmax/index.html @@ -1,89 +1,77 @@ -
- -