Skip to content

Commit b8e6064

Browse files
fix(datetime): remove unused page params from new e2e tests to fix build
Remove destructured { page } from test callbacks in the three new datetime E2E test files where page was declared but never referenced in the test body, resolving TypeScript "declared but its value is never read" errors that were breaking the build.
1 parent b7e66e8 commit b8e6064

4 files changed

Lines changed: 21 additions & 29 deletions

File tree

core/api.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -703,20 +703,21 @@ ion-datetime,prop,locale,string,'default',false,false
703703
ion-datetime,prop,max,string | undefined,undefined,false,false
704704
ion-datetime,prop,min,string | undefined,undefined,false,false
705705
ion-datetime,prop,minuteValues,number | number[] | string | undefined,undefined,false,false
706-
ion-datetime,prop,mode,"ios" | "md",undefined,false,false
706+
ion-datetime,prop,monthNavigation,"arrows" | "scroll",'arrows',false,false
707707
ion-datetime,prop,monthValues,number | number[] | string | undefined,undefined,false,false
708+
ion-datetime,prop,monthYearPickerView,"grid" | "wheel",'wheel',false,false
708709
ion-datetime,prop,multiple,boolean,false,false,false
709710
ion-datetime,prop,name,string,this.inputId,false,false
710711
ion-datetime,prop,preferWheel,boolean,false,false,false
711712
ion-datetime,prop,presentation,"date" | "date-time" | "month" | "month-year" | "time" | "time-date" | "year",'date-time',false,false
712713
ion-datetime,prop,readonly,boolean,false,false,false
714+
ion-datetime,prop,selectionMode,"multiple" | "range" | undefined,undefined,false,false
713715
ion-datetime,prop,showAdjacentDays,boolean,false,false,false
714716
ion-datetime,prop,showClearButton,boolean,false,false,false
715717
ion-datetime,prop,showDefaultButtons,boolean,false,false,false
716718
ion-datetime,prop,showDefaultTimeLabel,boolean,true,false,false
717719
ion-datetime,prop,showDefaultTitle,boolean,false,false,false
718720
ion-datetime,prop,size,"cover" | "fixed",'fixed',false,false
719-
ion-datetime,prop,theme,"ios" | "md" | "ionic",undefined,false,false
720721
ion-datetime,prop,titleSelectedDatesFormatter,((selectedDates: string[]) => string) | undefined,undefined,false,false
721722
ion-datetime,prop,value,null | string | string[] | undefined,undefined,false,false
722723
ion-datetime,prop,yearValues,number | number[] | string | undefined,undefined,false,false
@@ -742,10 +743,6 @@ ion-datetime,css-prop,--wheel-highlight-background,ios
742743
ion-datetime,css-prop,--wheel-highlight-background,md
743744
ion-datetime,css-prop,--wheel-highlight-border-radius,ios
744745
ion-datetime,css-prop,--wheel-highlight-border-radius,md
745-
ion-datetime,part,calendar-day
746-
ion-datetime,part,calendar-day active
747-
ion-datetime,part,calendar-day disabled
748-
ion-datetime,part,calendar-day today
749746
ion-datetime,part,calendar-days-of-week
750747
ion-datetime,part,calendar-header
751748
ion-datetime,part,datetime-header
@@ -755,11 +752,6 @@ ion-datetime,part,month-year-button
755752
ion-datetime,part,navigation-button
756753
ion-datetime,part,next-button
757754
ion-datetime,part,previous-button
758-
ion-datetime,part,time-button
759-
ion-datetime,part,time-button active
760-
ion-datetime,part,wheel
761-
ion-datetime,part,wheel-item
762-
ion-datetime,part,wheel-item active
763755

764756
ion-datetime-button,shadow
765757
ion-datetime-button,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,'primary',false,true

core/src/components/datetime/test/month-navigation/datetime.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
5151
await expect(datetime).not.toHaveClass(/datetime-month-navigation-scroll/);
5252
});
5353

54-
test('calendar-body should use vertical scroll axis when monthNavigation="scroll"', async ({ page }) => {
54+
test('calendar-body should use vertical scroll axis when monthNavigation="scroll"', async () => {
5555
const datetime = await fixture.goto(config, 'scroll');
5656
const calendarBody = datetime.locator('.calendar-body');
5757

@@ -68,7 +68,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
6868
expect(overflowY).toBe('scroll');
6969
});
7070

71-
test('calendar-body should use horizontal scroll axis when monthNavigation="arrows"', async ({ page }) => {
71+
test('calendar-body should use horizontal scroll axis when monthNavigation="arrows"', async () => {
7272
const datetime = await fixture.goto(config, 'arrows');
7373
const calendarBody = datetime.locator('.calendar-body');
7474

core/src/components/datetime/test/month-year-grid/datetime.e2e.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
7070
await expect(datetime).not.toHaveClass(/datetime-month-year-picker-grid/);
7171
});
7272

73-
test('clicking toggle button should show the grid picker', async ({ page }) => {
73+
test('clicking toggle button should show the grid picker', async () => {
7474
await fixture.goto(config);
7575
await fixture.openPicker();
7676

7777
const gridContainer = fixture.datetime.locator('.month-year-grid-container');
7878
await expect(gridContainer).toBeVisible();
7979
});
8080

81-
test('grid should show month cells', async ({ page }) => {
81+
test('grid should show month cells', async () => {
8282
await fixture.goto(config);
8383
await fixture.openPicker();
8484

@@ -87,7 +87,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
8787
await expect(monthCells).toHaveCount(12);
8888
});
8989

90-
test('grid should show year cells', async ({ page }) => {
90+
test('grid should show year cells', async () => {
9191
await fixture.goto(config);
9292
await fixture.openPicker();
9393

@@ -150,7 +150,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
150150
}
151151
});
152152

153-
test('disabled months should respect max constraint', async ({ page }) => {
153+
test('disabled months should respect max constraint', async () => {
154154
await fixture.goto(config, { max: '2022-03-31' });
155155
await fixture.openPicker();
156156

@@ -160,7 +160,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
160160
await expect(aprilCell).toHaveAttribute('disabled', '');
161161
});
162162

163-
test('disabled months should respect min constraint', async ({ page }) => {
163+
test('disabled months should respect min constraint', async () => {
164164
await fixture.goto(config, { min: '2022-09-01' });
165165
await fixture.openPicker();
166166

@@ -170,7 +170,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
170170
await expect(januaryCell).toHaveAttribute('disabled', '');
171171
});
172172

173-
test('picker should not show wheel picker when monthYearPickerView="grid"', async ({ page }) => {
173+
test('picker should not show wheel picker when monthYearPickerView="grid"', async () => {
174174
await fixture.goto(config, { monthYearPickerView: 'grid' });
175175
await fixture.openPicker();
176176

@@ -179,7 +179,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
179179
await expect(wheelPicker).not.toBeAttached();
180180
});
181181

182-
test('wheel mode should show ion-picker-column when monthYearPickerView="wheel"', async ({ page }) => {
182+
test('wheel mode should show ion-picker-column when monthYearPickerView="wheel"', async () => {
183183
await fixture.goto(config, { monthYearPickerView: 'wheel' });
184184
await fixture.openPicker();
185185

@@ -188,7 +188,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
188188
await expect(wheelPicker).toBeAttached();
189189
});
190190

191-
test('grid cells should display correct month names in locale', async ({ page }) => {
191+
test('grid cells should display correct month names in locale', async () => {
192192
await fixture.goto(config, { monthYearPickerView: 'grid' });
193193
await fixture.openPicker();
194194

@@ -197,7 +197,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
197197
await expect(monthCells.first()).toContainText('Jan');
198198
});
199199

200-
test('currently selected month should be highlighted in the grid', async ({ page }) => {
200+
test('currently selected month should be highlighted in the grid', async () => {
201201
await fixture.goto(config);
202202
await fixture.openPicker();
203203

core/src/components/datetime/test/range/datetime.e2e.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
166166
await expect(june20).toHaveClass(/calendar-day-range-end/);
167167
});
168168

169-
test('in-range days should have in-range CSS class but not be active', async ({ page }) => {
169+
test('in-range days should have in-range CSS class but not be active', async () => {
170170
const datetime = await fixture.goto(config, RANGE_VALUE);
171171

172172
for (let day = 11; day <= 19; day++) {
@@ -176,7 +176,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
176176
}
177177
});
178178

179-
test('days outside the range should not have range CSS classes', async ({ page }) => {
179+
test('days outside the range should not have range CSS classes', async () => {
180180
const datetime = await fixture.goto(config, RANGE_VALUE);
181181
const june5 = datetime.locator('[data-month="6"][data-day="5"]');
182182

@@ -185,21 +185,21 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
185185
await expect(june5).not.toHaveClass(/calendar-day-range-end/);
186186
});
187187

188-
test('wrapper element for range-start should have the correct class', async ({ page }) => {
188+
test('wrapper element for range-start should have the correct class', async () => {
189189
const datetime = await fixture.goto(config, RANGE_VALUE);
190190
const june10Wrapper = datetime.locator('[data-month="6"][data-day="10"]').locator('..');
191191

192192
await expect(june10Wrapper).toHaveClass(/calendar-day-wrapper-range-start/);
193193
});
194194

195-
test('wrapper element for in-range day should have the correct class', async ({ page }) => {
195+
test('wrapper element for in-range day should have the correct class', async () => {
196196
const datetime = await fixture.goto(config, RANGE_VALUE);
197197
const june15Wrapper = datetime.locator('[data-month="6"][data-day="15"]').locator('..');
198198

199199
await expect(june15Wrapper).toHaveClass(/calendar-day-wrapper-in-range/);
200200
});
201201

202-
test('wrapper element for range-end should have the correct class', async ({ page }) => {
202+
test('wrapper element for range-end should have the correct class', async () => {
203203
const datetime = await fixture.goto(config, RANGE_VALUE);
204204
const june20Wrapper = datetime.locator('[data-month="6"][data-day="20"]').locator('..');
205205

@@ -241,7 +241,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
241241
await expect(datetime).toHaveJSProperty('value', START_DATE);
242242
});
243243

244-
test('clear button should reset range selection', async ({ page }) => {
244+
test('clear button should reset range selection', async () => {
245245
const datetime = await fixture.goto(config, RANGE_VALUE, {
246246
showDefaultButtons: true,
247247
showClearButton: true,
@@ -252,7 +252,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
252252
await expect(datetime).toHaveJSProperty('value', undefined);
253253
});
254254

255-
test('disabled days should not be part of in-range highlight', async ({ page }) => {
255+
test('disabled days should not be part of in-range highlight', async () => {
256256
const datetime = await fixture.goto(config, RANGE_VALUE, {
257257
min: '2022-06-12', // days 10 and 11 are disabled (before min)
258258
});

0 commit comments

Comments
 (0)