@ionic/core 7.3.2 → 7.3.3-dev.11693454416.1cb6a7ec

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/components/ion-nav-link.js +7 -1
  2. package/components/label.js +2 -2
  3. package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
  4. package/dist/cjs/ion-nav_2.cjs.entry.js +7 -1
  5. package/dist/collection/components/checkbox/test/color/checkbox.e2e.js +2 -2
  6. package/dist/collection/components/checkbox/test/item/checkbox.e2e.js +4 -4
  7. package/dist/collection/components/checkbox/test/label/checkbox.e2e.js +10 -10
  8. package/dist/collection/components/checkbox/test/legacy/basic/checkbox.e2e.js +1 -1
  9. package/dist/collection/components/checkbox/test/legacy/indeterminate/checkbox.e2e.js +1 -1
  10. package/dist/collection/components/checkbox/test/states/checkbox.e2e.js +4 -4
  11. package/dist/collection/components/datetime/test/custom/datetime.e2e.js +0 -7
  12. package/dist/collection/components/input/test/bottom-content/input.e2e.js +7 -7
  13. package/dist/collection/components/input/test/card/input.e2e.js +1 -1
  14. package/dist/collection/components/input/test/color/input.e2e.js +15 -15
  15. package/dist/collection/components/input/test/fill/input.e2e.js +10 -10
  16. package/dist/collection/components/input/test/highlight/input.e2e.js +9 -9
  17. package/dist/collection/components/input/test/item/input.e2e.js +2 -2
  18. package/dist/collection/components/input/test/label-placement/input.e2e.js +16 -16
  19. package/dist/collection/components/input/test/legacy/basic/input.e2e.js +10 -10
  20. package/dist/collection/components/input/test/states/input.e2e.js +2 -2
  21. package/dist/collection/components/label/label.ios.css +2 -4
  22. package/dist/collection/components/label/label.md.css +2 -4
  23. package/dist/collection/components/nav-link/nav-link.js +7 -1
  24. package/dist/collection/components/radio/test/color/radio.e2e.js +2 -2
  25. package/dist/collection/components/radio/test/item/radio.e2e.js +3 -3
  26. package/dist/collection/components/radio/test/label-placement/radio.e2e.js +9 -9
  27. package/dist/collection/components/radio/test/states/radio.e2e.js +4 -4
  28. package/dist/collection/components/range/test/color/range.e2e.js +1 -1
  29. package/dist/collection/components/range/test/custom/range.e2e.js +1 -1
  30. package/dist/collection/components/range/test/item/range.e2e.js +3 -3
  31. package/dist/collection/components/range/test/label/range.e2e.js +12 -12
  32. package/dist/collection/components/range/test/legacy/a11y/range.e2e.js +3 -3
  33. package/dist/collection/components/range/test/legacy/active-bar-start/range.e2e.js +1 -1
  34. package/dist/collection/components/range/test/legacy/basic/range.e2e.js +1 -1
  35. package/dist/collection/components/range/test/states/range.e2e.js +4 -4
  36. package/dist/collection/components/select/test/card/select.e2e.js +1 -1
  37. package/dist/collection/components/select/test/color/select.e2e.js +3 -3
  38. package/dist/collection/components/select/test/fill/select.e2e.js +10 -10
  39. package/dist/collection/components/select/test/highlight/select.e2e.js +3 -3
  40. package/dist/collection/components/select/test/item/select.e2e.js +2 -2
  41. package/dist/collection/components/select/test/label/select.e2e.js +20 -20
  42. package/dist/collection/components/select/test/states/select.e2e.js +4 -4
  43. package/dist/collection/components/toggle/test/color/toggle.e2e.js +2 -2
  44. package/dist/collection/components/toggle/test/item/toggle.e2e.js +4 -4
  45. package/dist/collection/components/toggle/test/label/toggle.e2e.js +9 -9
  46. package/dist/collection/components/toggle/test/legacy/enable-on-off-labels/toggle.e2e.js +2 -2
  47. package/dist/collection/components/toggle/test/legacy/sizes/toggle.e2e.js +1 -1
  48. package/dist/collection/components/toggle/test/states/toggle.e2e.js +3 -3
  49. package/dist/docs.json +1 -1
  50. package/dist/esm/ion-item_8.entry.js +2 -2
  51. package/dist/esm/ion-nav_2.entry.js +7 -1
  52. package/dist/esm-es5/ion-item_8.entry.js +1 -1
  53. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  54. package/dist/ionic/ionic.esm.js +1 -1
  55. package/dist/ionic/{p-229df0d8.entry.js → p-0e6ca480.entry.js} +1 -1
  56. package/dist/ionic/{p-b9312889.entry.js → p-341d5877.entry.js} +1 -1
  57. package/dist/ionic/{p-79e30193.system.entry.js → p-5ba27716.system.entry.js} +1 -1
  58. package/dist/ionic/p-721933ff.system.js +1 -1
  59. package/dist/ionic/{p-d1356034.system.entry.js → p-c32e09fe.system.entry.js} +1 -1
  60. package/hydrate/index.js +9 -3
  61. package/package.json +1 -1
@@ -21,7 +21,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
21
21
  ></ion-input>
22
22
  `, config);
23
23
  const input = page.locator('ion-input');
24
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-solid`));
24
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-solid`));
25
25
  });
26
26
  test('should render correctly with floating label', async ({ page }) => {
27
27
  await page.setContent(`
@@ -36,7 +36,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
36
36
  ></ion-input>
37
37
  `, config);
38
38
  const input = page.locator('ion-input');
39
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-solid-label-floating`));
39
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-solid-label-floating`));
40
40
  });
41
41
  test('should not have visual regressions with shaped solid', async ({ page }) => {
42
42
  await page.setContent(`
@@ -51,7 +51,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
51
51
  ></ion-input>
52
52
  `, config);
53
53
  const input = page.locator('ion-input');
54
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-shaped-solid`));
54
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-shaped-solid`));
55
55
  });
56
56
  test('padding and border radius should be customizable', async ({ page }) => {
57
57
  await page.setContent(`
@@ -75,7 +75,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
75
75
  ></ion-input>
76
76
  `, config);
77
77
  const input = page.locator('ion-input');
78
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-shaped-solid-custom`));
78
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-shaped-solid-custom`));
79
79
  });
80
80
  });
81
81
  test.describe('input: fill outline', () => {
@@ -91,7 +91,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
91
91
  ></ion-input>
92
92
  `, config);
93
93
  const input = page.locator('ion-input');
94
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-outline`));
94
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-outline`));
95
95
  });
96
96
  test('should render correctly with floating label', async ({ page }) => {
97
97
  await page.setContent(`
@@ -106,7 +106,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
106
106
  ></ion-input>
107
107
  `, config);
108
108
  const input = page.locator('ion-input');
109
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-outline-label-floating`));
109
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-outline-label-floating`));
110
110
  });
111
111
  test('should not have visual regressions with shaped outline', async ({ page }) => {
112
112
  await page.setContent(`
@@ -121,7 +121,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
121
121
  ></ion-input>
122
122
  `, config);
123
123
  const input = page.locator('ion-input');
124
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-shaped-outline`));
124
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-shaped-outline`));
125
125
  });
126
126
  test('padding and border radius should be customizable', async ({ page }) => {
127
127
  await page.setContent(`
@@ -145,7 +145,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
145
145
  ></ion-input>
146
146
  `, config);
147
147
  const input = page.locator('ion-input');
148
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-shaped-outline-custom`));
148
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-shaped-outline-custom`));
149
149
  });
150
150
  });
151
151
  });
@@ -168,7 +168,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
168
168
  </ion-input>
169
169
  `, config);
170
170
  const input = page.locator('ion-input');
171
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-outline-slotted-label`));
171
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-outline-slotted-label`));
172
172
  });
173
173
  test('should render the notch correctly with a slotted label after the input was originally hidden', async ({ page, }) => {
174
174
  await page.setContent(`
@@ -188,7 +188,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
188
188
  `, config);
189
189
  const input = page.locator('ion-input');
190
190
  await input.evaluate((el) => el.style.removeProperty('display'));
191
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-fill-outline-hidden-slotted-label`));
191
+ await expect(input).toHaveScreenshot(screenshot(`input-fill-outline-hidden-slotted-label`));
192
192
  });
193
193
  });
194
194
  test.describe(title('input: notch cutout'), () => {
@@ -19,7 +19,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
19
19
  ></ion-input>
20
20
  `, config);
21
21
  const input = page.locator('ion-input');
22
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-no-fill-valid`));
22
+ await expect(input).toHaveScreenshot(screenshot(`input-no-fill-valid`));
23
23
  });
24
24
  test('should render invalid state correctly', async ({ page }) => {
25
25
  await page.setContent(`
@@ -34,7 +34,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
34
34
  ></ion-input>
35
35
  `, config);
36
36
  const input = page.locator('ion-input');
37
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-no-fill-invalid`));
37
+ await expect(input).toHaveScreenshot(screenshot(`input-no-fill-invalid`));
38
38
  });
39
39
  test('should render focused state correctly', async ({ page }) => {
40
40
  await page.setContent(`
@@ -49,7 +49,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
49
49
  ></ion-input>
50
50
  `, config);
51
51
  const input = page.locator('ion-input');
52
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-no-fill-focus`));
52
+ await expect(input).toHaveScreenshot(screenshot(`input-no-fill-focus`));
53
53
  });
54
54
  });
55
55
  test.describe('input: solid', () => {
@@ -67,7 +67,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
67
67
  ></ion-input>
68
68
  `, config);
69
69
  const input = page.locator('ion-input');
70
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-solid-valid`));
70
+ await expect(input).toHaveScreenshot(screenshot(`input-solid-valid`));
71
71
  });
72
72
  test('should render invalid state correctly', async ({ page }) => {
73
73
  await page.setContent(`
@@ -83,7 +83,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
83
83
  ></ion-input>
84
84
  `, config);
85
85
  const input = page.locator('ion-input');
86
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-solid-invalid`));
86
+ await expect(input).toHaveScreenshot(screenshot(`input-solid-invalid`));
87
87
  });
88
88
  test('should render focused state correctly', async ({ page }) => {
89
89
  await page.setContent(`
@@ -99,7 +99,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
99
99
  ></ion-input>
100
100
  `, config);
101
101
  const input = page.locator('ion-input');
102
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-solid-focus`));
102
+ await expect(input).toHaveScreenshot(screenshot(`input-solid-focus`));
103
103
  });
104
104
  });
105
105
  test.describe('input: outline', () => {
@@ -117,7 +117,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
117
117
  ></ion-input>
118
118
  `, config);
119
119
  const input = page.locator('ion-input');
120
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-outline-valid`));
120
+ await expect(input).toHaveScreenshot(screenshot(`input-outline-valid`));
121
121
  });
122
122
  test('should render invalid state correctly', async ({ page }) => {
123
123
  await page.setContent(`
@@ -133,7 +133,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
133
133
  ></ion-input>
134
134
  `, config);
135
135
  const input = page.locator('ion-input');
136
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-outline-invalid`));
136
+ await expect(input).toHaveScreenshot(screenshot(`input-outline-invalid`));
137
137
  });
138
138
  test('should render focused state correctly', async ({ page }) => {
139
139
  await page.setContent(`
@@ -149,7 +149,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
149
149
  ></ion-input>
150
150
  `, config);
151
151
  const input = page.locator('ion-input');
152
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-outline-focus`));
152
+ await expect(input).toHaveScreenshot(screenshot(`input-outline-focus`));
153
153
  });
154
154
  });
155
155
  });
@@ -20,7 +20,7 @@ configs().forEach(({ title, screenshot, config }) => {
20
20
  </ion-list>
21
21
  `, config);
22
22
  const list = page.locator('ion-list');
23
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`input-list-no-fill`));
23
+ await expect(list).toHaveScreenshot(screenshot(`input-list-no-fill`));
24
24
  });
25
25
  test('should render correctly in inset list with no fill', async ({ page }) => {
26
26
  await page.setContent(`
@@ -37,7 +37,7 @@ configs().forEach(({ title, screenshot, config }) => {
37
37
  </ion-list>
38
38
  `, config);
39
39
  const list = page.locator('ion-list');
40
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`input-inset-list-no-fill`));
40
+ await expect(list).toHaveScreenshot(screenshot(`input-inset-list-no-fill`));
41
41
  });
42
42
  });
43
43
  });
@@ -10,7 +10,7 @@ configs().forEach(({ title, screenshot, config }) => {
10
10
  <ion-input label="Email" value="example@ionic.io" label-placement="start"></ion-input>
11
11
  `, config);
12
12
  const input = page.locator('ion-input');
13
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-start`));
13
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-start`));
14
14
  });
15
15
  });
16
16
  test.describe(title('input: label placement end'), () => {
@@ -19,7 +19,7 @@ configs().forEach(({ title, screenshot, config }) => {
19
19
  <ion-input label="Email" value="example@ionic.io" label-placement="end"></ion-input>
20
20
  `, config);
21
21
  const input = page.locator('ion-input');
22
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-end`));
22
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-end`));
23
23
  });
24
24
  });
25
25
  test.describe(title('input: label placement fixed'), () => {
@@ -28,7 +28,7 @@ configs().forEach(({ title, screenshot, config }) => {
28
28
  <ion-input label="Email Email Email Email Email Email" value="example@ionic.io" label-placement="fixed"></ion-input>
29
29
  `, config);
30
30
  const input = page.locator('ion-input');
31
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-fixed`));
31
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-fixed`));
32
32
  });
33
33
  });
34
34
  test.describe(title('input: label placement stacked'), () => {
@@ -37,21 +37,21 @@ configs().forEach(({ title, screenshot, config }) => {
37
37
  <ion-input label="Email" value="example@ionic.io" label-placement="stacked"></ion-input>
38
38
  `, config);
39
39
  const input = page.locator('ion-input');
40
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-stacked-value`));
40
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-stacked-value`));
41
41
  });
42
42
  test('label should appear above the input when there is a no value', async ({ page }) => {
43
43
  await page.setContent(`
44
44
  <ion-input label="Email" label-placement="stacked"></ion-input>
45
45
  `, config);
46
46
  const input = page.locator('ion-input');
47
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-stacked-no-value`));
47
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-stacked-no-value`));
48
48
  });
49
49
  test('long label should truncate', async ({ page }) => {
50
50
  await page.setContent(`
51
51
  <ion-input label="Email Email Email Email Email Email Email Email Email Email Email Email" value="example@ionic.io" label-placement="stacked"></ion-input>
52
52
  `, config);
53
53
  const input = page.locator('ion-input');
54
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-stacked-long-label`));
54
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-stacked-long-label`));
55
55
  });
56
56
  });
57
57
  test.describe(title('input: label placement floating'), () => {
@@ -60,14 +60,14 @@ configs().forEach(({ title, screenshot, config }) => {
60
60
  <ion-input label="Email" value="example@ionic.io" label-placement="floating"></ion-input>
61
61
  `, config);
62
62
  const input = page.locator('ion-input');
63
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-floating-value`));
63
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-floating-value`));
64
64
  });
65
65
  test('label should appear on top of the input and hide the input when there is a no value', async ({ page }) => {
66
66
  await page.setContent(`
67
67
  <ion-input label="Email" label-placement="floating" placeholder="example@ionic.io"></ion-input>
68
68
  `, config);
69
69
  const input = page.locator('ion-input');
70
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-floating-no-value`));
70
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-floating-no-value`));
71
71
  });
72
72
  test('label should appear on top of the input when the input is focused', async ({ page }) => {
73
73
  await page.setContent(`
@@ -77,14 +77,14 @@ configs().forEach(({ title, screenshot, config }) => {
77
77
  const nativeInput = input.locator('input');
78
78
  await nativeInput.click();
79
79
  await page.waitForChanges();
80
- expect(await input.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`input-focused-placement-floating-no-value`));
80
+ await expect(input).toHaveScreenshot(screenshot(`input-focused-placement-floating-no-value`));
81
81
  });
82
82
  test('long label should truncate', async ({ page }) => {
83
83
  await page.setContent(`
84
84
  <ion-input label="Email Email Email Email Email Email Email Email Email Email Email Email" value="example@ionic.io" label-placement="floating"></ion-input>
85
85
  `, config);
86
86
  const input = page.locator('ion-input');
87
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-floating-long-label`));
87
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-floating-long-label`));
88
88
  });
89
89
  });
90
90
  });
@@ -98,14 +98,14 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
98
98
  <ion-input fill="outline" label="Email Email Email Email Email Email Email Email Email Email Email Email" value="example@ionic.io" label-placement="floating"></ion-input>
99
99
  `, config);
100
100
  const input = page.locator('ion-input');
101
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-floating-long-label-outline`));
101
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-floating-long-label-outline`));
102
102
  });
103
103
  test('long label should truncate with solid', async ({ page }) => {
104
104
  await page.setContent(`
105
105
  <ion-input fill="solid" label="Email Email Email Email Email Email Email Email Email Email Email Email" value="example@ionic.io" label-placement="floating"></ion-input>
106
106
  `, config);
107
107
  const input = page.locator('ion-input');
108
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-placement-floating-long-label-solid`));
108
+ await expect(input).toHaveScreenshot(screenshot(`input-placement-floating-long-label-solid`));
109
109
  });
110
110
  });
111
111
  });
@@ -116,7 +116,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
116
116
  <ion-input label="Label Label Label Label Label" placeholder="Text Input"></ion-input>
117
117
  `, config);
118
118
  const input = page.locator('ion-input');
119
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-label-truncate`));
119
+ await expect(input).toHaveScreenshot(screenshot(`input-label-truncate`));
120
120
  });
121
121
  test('label slot should be truncated with an ellipsis', async ({ page }) => {
122
122
  await page.setContent(`
@@ -125,7 +125,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
125
125
  </ion-input>
126
126
  `, config);
127
127
  const input = page.locator('ion-input');
128
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-label-slot-truncate`));
128
+ await expect(input).toHaveScreenshot(screenshot(`input-label-slot-truncate`));
129
129
  });
130
130
  });
131
131
  test.describe(title('input: async label'), () => {
@@ -141,7 +141,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
141
141
  el.appendChild(labelEl);
142
142
  });
143
143
  await page.waitForChanges();
144
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-async-label`));
144
+ await expect(input).toHaveScreenshot(screenshot(`input-async-label`));
145
145
  });
146
146
  });
147
147
  test.describe(title('input: floating/stacked label layering'), () => {
@@ -159,7 +159,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
159
159
  <ion-input class="custom-input" label="My Label" label-placement="stacked"></ion-input>
160
160
  `, config);
161
161
  const input = page.locator('ion-input');
162
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-label-layering`));
162
+ await expect(input).toHaveScreenshot(screenshot(`input-label-layering`));
163
163
  });
164
164
  });
165
165
  });
@@ -18,7 +18,7 @@ configs().forEach(({ title, screenshot, config }) => {
18
18
  `, config);
19
19
  const item = page.locator('ion-item');
20
20
  // Validates the display of an input where text extends off the edge of the component.
21
- expect(await item.screenshot()).toMatchSnapshot(screenshot(`input-with-text-overflow`));
21
+ await expect(item).toHaveScreenshot(screenshot(`input-with-text-overflow`));
22
22
  });
23
23
  });
24
24
  test.describe('input with placeholder', () => {
@@ -34,7 +34,7 @@ configs().forEach(({ title, screenshot, config }) => {
34
34
  `, config);
35
35
  const item = page.locator('ion-item');
36
36
  // Validates the display of an input with a placeholder.
37
- expect(await item.screenshot()).toMatchSnapshot(screenshot(`input-with-placeholder`));
37
+ await expect(item).toHaveScreenshot(screenshot(`input-with-placeholder`));
38
38
  });
39
39
  });
40
40
  test.describe('input disabled', () => {
@@ -50,7 +50,7 @@ configs().forEach(({ title, screenshot, config }) => {
50
50
  `, config);
51
51
  const item = page.locator('ion-item');
52
52
  // Validates the display of an input in a disabled state.
53
- expect(await item.screenshot()).toMatchSnapshot(screenshot(`input-disabled`));
53
+ await expect(item).toHaveScreenshot(screenshot(`input-disabled`));
54
54
  });
55
55
  });
56
56
  test.describe('input with lines="full"', () => {
@@ -67,12 +67,12 @@ configs().forEach(({ title, screenshot, config }) => {
67
67
  const item = page.locator('ion-item');
68
68
  const input = page.locator('ion-input');
69
69
  // Validates the display of an input with an ion-item using lines="full".
70
- expect(await item.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`input-with-lines-full`));
70
+ await expect(item).toHaveScreenshot(screenshot(`input-with-lines-full`));
71
71
  await input.click();
72
72
  // Verifies that the parent item receives .item-has-focus when the input is focused.
73
73
  await expect(item).toHaveClass(/item-has-focus/);
74
74
  // Validates the display of an input with an ion-item using lines="full" when focused.
75
- expect(await item.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`input-with-lines-full-focused`));
75
+ await expect(item).toHaveScreenshot(screenshot(`input-with-lines-full-focused`));
76
76
  });
77
77
  });
78
78
  test.describe('input with lines="inset"', () => {
@@ -89,12 +89,12 @@ configs().forEach(({ title, screenshot, config }) => {
89
89
  const item = page.locator('ion-item');
90
90
  const input = page.locator('ion-input');
91
91
  // Validates the display of an input with an ion-item using lines="inset".
92
- expect(await item.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`input-with-lines-inset`));
92
+ await expect(item).toHaveScreenshot(screenshot(`input-with-lines-inset`));
93
93
  await input.click();
94
94
  // Verifies that the parent item receives .item-has-focus when the input is focused.
95
95
  await expect(item).toHaveClass(/item-has-focus/);
96
96
  // Validates the display of an input with an ion-item using lines="inset" when focused.
97
- expect(await item.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`input-with-lines-inset-focused`));
97
+ await expect(item).toHaveScreenshot(screenshot(`input-with-lines-inset-focused`));
98
98
  });
99
99
  });
100
100
  test.describe('input with lines="none"', () => {
@@ -111,12 +111,12 @@ configs().forEach(({ title, screenshot, config }) => {
111
111
  const item = page.locator('ion-item');
112
112
  const input = page.locator('ion-input');
113
113
  // Validates the display of an input with an ion-item using lines="none".
114
- expect(await item.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`input-with-lines-none`));
114
+ await expect(item).toHaveScreenshot(screenshot(`input-with-lines-none`));
115
115
  await input.click();
116
116
  // Verifies that the parent item receives .item-has-focus when the input is focused.
117
117
  await expect(item).toHaveClass(/item-has-focus/);
118
118
  // Validates the display of an input with an ion-item using lines="none" when focused.
119
- expect(await item.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`input-with-lines-none-focused`));
119
+ await expect(item).toHaveScreenshot(screenshot(`input-with-lines-none-focused`));
120
120
  });
121
121
  });
122
122
  test.describe('input with clear button', () => {
@@ -137,7 +137,7 @@ configs().forEach(({ title, screenshot, config }) => {
137
137
  `, config);
138
138
  const item = page.locator('ion-item');
139
139
  // Validates the display of an input with a clear button.
140
- expect(await item.screenshot()).toMatchSnapshot(screenshot(`input-with-clear-button`));
140
+ await expect(item).toHaveScreenshot(screenshot(`input-with-clear-button`));
141
141
  });
142
142
  });
143
143
  });
@@ -10,14 +10,14 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
10
10
  <ion-input label="Email" value="hi@ionic.io" readonly="true"></ion-input>
11
11
  `, config);
12
12
  const input = page.locator('ion-input');
13
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-readonly`));
13
+ await expect(input).toHaveScreenshot(screenshot(`input-readonly`));
14
14
  });
15
15
  test('should render disabled input correctly', async ({ page }) => {
16
16
  await page.setContent(`
17
17
  <ion-input label="Email" value="hi@ionic.io" disabled="true"></ion-input>
18
18
  `, config);
19
19
  const input = page.locator('ion-input');
20
- expect(await input.screenshot()).toMatchSnapshot(screenshot(`input-disabled`));
20
+ await expect(input).toHaveScreenshot(screenshot(`input-disabled`));
21
21
  });
22
22
  });
23
23
  });
@@ -17,8 +17,7 @@
17
17
  color: var(--ion-color-base);
18
18
  }
19
19
 
20
- :host(.ion-text-wrap),
21
- :host([text-wrap]) {
20
+ :host(.ion-text-wrap) {
22
21
  white-space: normal;
23
22
  }
24
23
 
@@ -67,8 +66,7 @@
67
66
  overflow: inherit;
68
67
  }
69
68
 
70
- :host(.ion-text-wrap),
71
- :host([text-wrap]) {
69
+ :host(.ion-text-wrap) {
72
70
  font-size: 14px;
73
71
  line-height: 1.5;
74
72
  }
@@ -17,8 +17,7 @@
17
17
  color: var(--ion-color-base);
18
18
  }
19
19
 
20
- :host(.ion-text-wrap),
21
- :host([text-wrap]) {
20
+ :host(.ion-text-wrap) {
22
21
  white-space: normal;
23
22
  }
24
23
 
@@ -67,8 +66,7 @@
67
66
  overflow: inherit;
68
67
  }
69
68
 
70
- :host(.ion-text-wrap),
71
- :host([text-wrap]) {
69
+ :host(.ion-text-wrap) {
72
70
  line-height: 1.5;
73
71
  }
74
72
 
@@ -6,7 +6,13 @@ import { navLink } from "./nav-link-utils";
6
6
  export class NavLink {
7
7
  constructor() {
8
8
  this.onClick = () => {
9
- return navLink(this.el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);
9
+ const { el } = this;
10
+ const button = el.querySelector('button,ion-button,a');
11
+ if (button === null || button === void 0 ? void 0 : button.hasAttribute('disabled')) {
12
+ // Do not navigate if the button is disabled
13
+ return;
14
+ }
15
+ return navLink(el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);
10
16
  };
11
17
  this.component = undefined;
12
18
  this.componentProps = undefined;
@@ -12,7 +12,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
12
12
  </ion-radio-group>
13
13
  `, config);
14
14
  const radio = page.locator('ion-radio');
15
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-color-checked`));
15
+ await expect(radio).toHaveScreenshot(screenshot(`radio-color-checked`));
16
16
  });
17
17
  test('should not apply color when unchecked', async ({ page }) => {
18
18
  await page.setContent(`
@@ -21,7 +21,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
21
21
  </ion-radio-group>
22
22
  `, config);
23
23
  const radio = page.locator('ion-radio');
24
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-color-unchecked`));
24
+ await expect(radio).toHaveScreenshot(screenshot(`radio-color-unchecked`));
25
25
  });
26
26
  });
27
27
  });
@@ -16,7 +16,7 @@ configs().forEach(({ title, screenshot, config }) => {
16
16
  </ion-list>
17
17
  `, config);
18
18
  const list = page.locator('ion-list');
19
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`toggle-list`));
19
+ await expect(list).toHaveScreenshot(screenshot(`toggle-list`));
20
20
  });
21
21
  test('should render correctly in inset list', async ({ page }) => {
22
22
  await page.setContent(`
@@ -29,7 +29,7 @@ configs().forEach(({ title, screenshot, config }) => {
29
29
  </ion-list>
30
30
  `, config);
31
31
  const list = page.locator('ion-list');
32
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`radio-inset-list`));
32
+ await expect(list).toHaveScreenshot(screenshot(`radio-inset-list`));
33
33
  });
34
34
  });
35
35
  });
@@ -48,7 +48,7 @@ configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, co
48
48
  </ion-list>
49
49
  `, config);
50
50
  const list = page.locator('ion-list');
51
- expect(await list.screenshot()).toMatchSnapshot(screenshot(`radio-long-label-in-item`));
51
+ await expect(list).toHaveScreenshot(screenshot(`radio-long-label-in-item`));
52
52
  });
53
53
  });
54
54
  });
@@ -21,7 +21,7 @@ configs().forEach(({ title, screenshot, config }) => {
21
21
  </ion-radio-group>
22
22
  `, config);
23
23
  const radio = page.locator('ion-radio');
24
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-start-justify-start`));
24
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-start-justify-start`));
25
25
  });
26
26
  test('should render an end justification with label in the start position', async ({ page }) => {
27
27
  await page.setContent(`
@@ -30,7 +30,7 @@ configs().forEach(({ title, screenshot, config }) => {
30
30
  </ion-radio-group>
31
31
  `, config);
32
32
  const radio = page.locator('ion-radio');
33
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-start-justify-end`));
33
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-start-justify-end`));
34
34
  });
35
35
  test('should render a space between justification with label in the start position', async ({ page }) => {
36
36
  await page.setContent(`
@@ -39,7 +39,7 @@ configs().forEach(({ title, screenshot, config }) => {
39
39
  </ion-radio-group>
40
40
  `, config);
41
41
  const radio = page.locator('ion-radio');
42
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-start-justify-space-between`));
42
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-start-justify-space-between`));
43
43
  });
44
44
  });
45
45
  test.describe('radio: end placement', () => {
@@ -50,7 +50,7 @@ configs().forEach(({ title, screenshot, config }) => {
50
50
  </ion-radio-group>
51
51
  `, config);
52
52
  const radio = page.locator('ion-radio');
53
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-end-justify-start`));
53
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-end-justify-start`));
54
54
  });
55
55
  test('should render an end justification with label in the end position', async ({ page }) => {
56
56
  await page.setContent(`
@@ -59,7 +59,7 @@ configs().forEach(({ title, screenshot, config }) => {
59
59
  </ion-radio-group>
60
60
  `, config);
61
61
  const radio = page.locator('ion-radio');
62
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-end-justify-end`));
62
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-end-justify-end`));
63
63
  });
64
64
  test('should render a space between justification with label in the end position', async ({ page }) => {
65
65
  await page.setContent(`
@@ -68,7 +68,7 @@ configs().forEach(({ title, screenshot, config }) => {
68
68
  </ion-radio-group>
69
69
  `, config);
70
70
  const radio = page.locator('ion-radio');
71
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-end-justify-space-between`));
71
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-end-justify-space-between`));
72
72
  });
73
73
  });
74
74
  test.describe('radio: fixed placement', () => {
@@ -79,7 +79,7 @@ configs().forEach(({ title, screenshot, config }) => {
79
79
  </ion-radio-group>
80
80
  `, config);
81
81
  const radio = page.locator('ion-radio');
82
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-fixed-justify-start`));
82
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-fixed-justify-start`));
83
83
  });
84
84
  test('should render an end justification with label in the fixed position', async ({ page }) => {
85
85
  await page.setContent(`
@@ -88,7 +88,7 @@ configs().forEach(({ title, screenshot, config }) => {
88
88
  </ion-radio-group>
89
89
  `, config);
90
90
  const radio = page.locator('ion-radio');
91
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-fixed-justify-end`));
91
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-fixed-justify-end`));
92
92
  });
93
93
  test('should render a space between justification with label in the fixed position', async ({ page }) => {
94
94
  await page.setContent(`
@@ -97,7 +97,7 @@ configs().forEach(({ title, screenshot, config }) => {
97
97
  </ion-radio-group>
98
98
  `, config);
99
99
  const radio = page.locator('ion-radio');
100
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-label-fixed-justify-space-between`));
100
+ await expect(radio).toHaveScreenshot(screenshot(`radio-label-fixed-justify-space-between`));
101
101
  });
102
102
  });
103
103
  });
@@ -12,7 +12,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
12
12
  </ion-radio-group>
13
13
  `, config);
14
14
  const radio = page.locator('ion-radio');
15
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-disabled`));
15
+ await expect(radio).toHaveScreenshot(screenshot(`radio-disabled`));
16
16
  });
17
17
  test('should render disabled checked radio correctly', async ({ page }) => {
18
18
  await page.setContent(`
@@ -21,7 +21,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
21
21
  </ion-radio-group>
22
22
  `, config);
23
23
  const radio = page.locator('ion-radio');
24
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-checked-disabled`));
24
+ await expect(radio).toHaveScreenshot(screenshot(`radio-checked-disabled`));
25
25
  });
26
26
  test('should render checked radio correctly', async ({ page }) => {
27
27
  await page.setContent(`
@@ -30,7 +30,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
30
30
  </ion-radio-group>
31
31
  `, config);
32
32
  const radio = page.locator('ion-radio');
33
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-checked`));
33
+ await expect(radio).toHaveScreenshot(screenshot(`radio-checked`));
34
34
  });
35
35
  test('should render unchecked radio correctly', async ({ page }) => {
36
36
  await page.setContent(`
@@ -39,7 +39,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
39
39
  </ion-radio-group>
40
40
  `, config);
41
41
  const radio = page.locator('ion-radio');
42
- expect(await radio.screenshot()).toMatchSnapshot(screenshot(`radio-unchecked`));
42
+ await expect(radio).toHaveScreenshot(screenshot(`radio-unchecked`));
43
43
  });
44
44
  });
45
45
  });