Skip to content

Commit 178cd5b

Browse files
test(datetime): add tests of getDaysOfWeek method for ionic theme
1 parent 3a70fb5 commit 178cd5b

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

core/src/components/datetime/test/data.spec.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DatetimeParts } from '../datetime-interface';
2+
import type { Theme } from '../../../interface';
23
import {
34
generateMonths,
45
getDaysOfWeek,
@@ -133,24 +134,29 @@ describe('generateMonths()', () => {
133134
});
134135

135136
describe('getDaysOfWeek()', () => {
136-
it('should return English short names given a locale and mode', () => {
137-
expect(getDaysOfWeek('en-US', 'ios')).toEqual(['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']);
137+
const themes: Theme[] = ['ios', 'ionic'];
138+
it.each<Theme>(themes)('should return English short names given a locale and theme %s', (theme) => {
139+
expect(getDaysOfWeek('en-US', theme)).toEqual(['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']);
138140
});
139141

140-
it('should return English narrow names given a locale and mode', () => {
142+
it('should return English narrow names given a locale and theme md', () => {
141143
expect(getDaysOfWeek('en-US', 'md')).toEqual(['S', 'M', 'T', 'W', 'T', 'F', 'S']);
142144
});
143145

144-
it('should return Spanish short names given a locale and mode', () => {
145-
expect(getDaysOfWeek('es-ES', 'ios')).toEqual(['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb']);
146+
it.each<Theme>(themes)('should return Spanish short names given a locale and theme %s', (theme) => {
147+
expect(getDaysOfWeek('es-ES', theme)).toEqual(['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb']);
146148
});
147149

148-
it('should return Spanish narrow names given a locale and mode', () => {
150+
it('should return Spanish narrow names given a locale and theme md', () => {
149151
expect(getDaysOfWeek('es-ES', 'md')).toEqual(['D', 'L', 'M', 'X', 'J', 'V', 'S']);
150152
});
151153

152-
it('should return English short names given a locale, mode and startOfWeek', () => {
153-
expect(getDaysOfWeek('en-US', 'ios', 1)).toEqual(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']);
154+
it.each<Theme>(themes)('should return English short names given a locale and startOfWeek and theme %s', (theme) => {
155+
expect(getDaysOfWeek('en-US', theme, 1)).toEqual(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']);
156+
});
157+
158+
it('should return English narrow names given a locale and startOfWeek and theme md', () => {
159+
expect(getDaysOfWeek('en-US', 'md', 1)).toEqual(['M', 'T', 'W', 'T', 'F', 'S', 'S']);
154160
});
155161
});
156162

0 commit comments

Comments
 (0)