|
1 | 1 | import type { DatetimeParts } from '../datetime-interface'; |
| 2 | +import type { Theme } from '../../../interface'; |
2 | 3 | import { |
3 | 4 | generateMonths, |
4 | 5 | getDaysOfWeek, |
@@ -133,24 +134,29 @@ describe('generateMonths()', () => { |
133 | 134 | }); |
134 | 135 |
|
135 | 136 | 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']); |
138 | 140 | }); |
139 | 141 |
|
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', () => { |
141 | 143 | expect(getDaysOfWeek('en-US', 'md')).toEqual(['S', 'M', 'T', 'W', 'T', 'F', 'S']); |
142 | 144 | }); |
143 | 145 |
|
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']); |
146 | 148 | }); |
147 | 149 |
|
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', () => { |
149 | 151 | expect(getDaysOfWeek('es-ES', 'md')).toEqual(['D', 'L', 'M', 'X', 'J', 'V', 'S']); |
150 | 152 | }); |
151 | 153 |
|
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']); |
154 | 160 | }); |
155 | 161 | }); |
156 | 162 |
|
|
0 commit comments