Skip to content

Commit bf34e0e

Browse files
liamdebeasiIonitronthetaPC
authored
test: migrate form control usages to modern syntax (#28897)
Issue number: Internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Several tests were still using the legacy form syntax. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Migrated tests in `core`, `angular`, and `vue` to use the modern form syntax (`react` did not have form controls). I opted not to migrate `item/test/highlight` and `item/test/counter` because those tests are going to be removed in the future once the deprecate item APIs are removed. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: ionitron <[email protected]> Co-authored-by: Maria Hutt <[email protected]>
1 parent f6fc22b commit bf34e0e

File tree

123 files changed

+164
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+164
-323
lines changed

core/src/components/accordion/test/a11y/index.html

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,22 @@ <h1>Accordion Group - a11y</h1>
2323

2424
<ion-list slot="content">
2525
<ion-item>
26-
<ion-label>Name</ion-label>
27-
<ion-input type="text"></ion-input>
26+
<ion-input label="Name" type="text"></ion-input>
2827
</ion-item>
2928
<ion-item>
30-
<ion-label>Email</ion-label>
31-
<ion-input type="email"></ion-input>
29+
<ion-input label="Email" type="email"></ion-input>
3230
</ion-item>
3331
<ion-item>
34-
<ion-label>Phone</ion-label>
35-
<ion-input type="tel"></ion-input>
32+
<ion-input label="Phone" type="tel"></ion-input>
3633
</ion-item>
3734
<ion-item>
38-
<ion-label>Extension</ion-label>
39-
<ion-input type="text"></ion-input>
35+
<ion-input label="Extension" type="text"></ion-input>
4036
</ion-item>
4137
<ion-item>
42-
<ion-label>Country</ion-label>
43-
<ion-input type="text"></ion-input>
38+
<ion-input label="Country" type="text"></ion-input>
4439
</ion-item>
4540
<ion-item>
46-
<ion-label>City/Province</ion-label>
47-
<ion-input type="text"></ion-input>
41+
<ion-input label="City/Province" type="text"></ion-input>
4842
</ion-item>
4943
</ion-list>
5044
</ion-accordion>
@@ -56,24 +50,19 @@ <h1>Accordion Group - a11y</h1>
5650

5751
<ion-list slot="content">
5852
<ion-item>
59-
<ion-label>Address 1</ion-label>
60-
<ion-input type="text"></ion-input>
53+
<ion-input label="Address 1" type="text"></ion-input>
6154
</ion-item>
6255
<ion-item>
63-
<ion-label>Address 2</ion-label>
64-
<ion-input type="email"></ion-input>
56+
<ion-input label="Address 2" type="email"></ion-input>
6557
</ion-item>
6658
<ion-item>
67-
<ion-label>City</ion-label>
68-
<ion-input type="tel"></ion-input>
59+
<ion-input label="City" type="tel"></ion-input>
6960
</ion-item>
7061
<ion-item>
71-
<ion-label>State</ion-label>
72-
<ion-input type="text"></ion-input>
62+
<ion-input label="State" type="text"></ion-input>
7363
</ion-item>
7464
<ion-item>
75-
<ion-label>Zip Code</ion-label>
76-
<ion-input type="text"></ion-input>
65+
<ion-input label="Zip Code" type="text"></ion-input>
7766
</ion-item>
7867
</ion-list>
7968
</ion-accordion>
@@ -85,24 +74,19 @@ <h1>Accordion Group - a11y</h1>
8574

8675
<ion-list slot="content">
8776
<ion-item>
88-
<ion-label>Address 1</ion-label>
89-
<ion-input id="address1" type="text"></ion-input>
77+
<ion-input label="Address 1" id="address1" type="text"></ion-input>
9078
</ion-item>
9179
<ion-item>
92-
<ion-label>Address 2</ion-label>
93-
<ion-input type="email"></ion-input>
80+
<ion-input label="Address 2" type="email"></ion-input>
9481
</ion-item>
9582
<ion-item>
96-
<ion-label>City</ion-label>
97-
<ion-input type="tel"></ion-input>
83+
<ion-input label="City" type="tel"></ion-input>
9884
</ion-item>
9985
<ion-item>
100-
<ion-label>State</ion-label>
101-
<ion-input type="text"></ion-input>
86+
<ion-input lable="State" type="text"></ion-input>
10287
</ion-item>
10388
<ion-item>
104-
<ion-label>Zip Code</ion-label>
105-
<ion-input type="text"></ion-input>
89+
<ion-input label="Zip Code" type="text"></ion-input>
10690
</ion-item>
10791
</ion-list>
10892
</ion-accordion>

core/src/components/datetime-button/test/buttons/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</ion-header>
1919
<ion-content>
2020
<ion-item>
21-
<ion-input value="March 15, 2022 at 12:43 AM"></ion-input>
21+
<ion-input aria-label="input" value="March 15, 2022 at 12:43 AM"></ion-input>
2222
<ion-datetime-button slot="end" id="default-button" datetime="default-datetime">
2323
<ion-icon color="primary" id="custom-date-button" slot="date-target" name="calendar"></ion-icon>
2424
<ion-icon color="primary" id="custom-time-button" slot="time-target" name="time"></ion-icon>

core/src/components/datetime/test/basic/index.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@
214214
<ion-popover class="options-popover" trigger="popover-trigger">
215215
<ion-list lines="none">
216216
<ion-item>
217-
<ion-label>Dark Mode</ion-label>
218-
<ion-checkbox slot="end"></ion-checkbox>
217+
<ion-checkbox>Dark Mode</ion-checkbox>
219218
</ion-item>
220219
<ion-item detail="true" href="?ionic:mode=ios">
221220
<ion-label>iOS Mode</ion-label>
@@ -225,23 +224,19 @@
225224
</ion-item>
226225

227226
<ion-item>
228-
<ion-label>Show Default Title</ion-label>
229-
<ion-toggle id="titleToggle"></ion-toggle>
227+
<ion-toggle id="titleToggle">Show Default Title</ion-toggle>
230228
</ion-item>
231229

232230
<ion-item>
233-
<ion-label>Show Default Buttons</ion-label>
234-
<ion-toggle id="buttonsToggle"></ion-toggle>
231+
<ion-toggle id="buttonsToggle">Show Default Buttons</ion-toggle>
235232
</ion-item>
236233

237234
<ion-item>
238-
<ion-label>Locale</ion-label>
239-
<ion-input placeholder="default" id="locale"></ion-input>
235+
<ion-input label="Locale" placeholder="default" id="locale"></ion-input>
240236
</ion-item>
241237

242238
<ion-item>
243-
<ion-label>Color</ion-label>
244-
<ion-select id="color" value="primary">
239+
<ion-select label="Color" id="color" value="primary">
245240
<ion-select-option value="primary">Primary</ion-select-option>
246241
<ion-select-option value="secondary">Secondary</ion-select-option>
247242
<ion-select-option value="tertiary">Tertiary</ion-select-option>

core/src/components/item/test/a11y/index.html

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,19 @@
1616
<h1>Item</h1>
1717

1818
<ion-item>
19-
<ion-label>Item with Input</ion-label>
20-
<ion-input placeholder="Placeholder"></ion-input>
19+
<ion-input label="Item with Input" placeholder="Placeholder"></ion-input>
2120
</ion-item>
2221

2322
<ion-item disabled>
24-
<ion-label>Item disabled with Input</ion-label>
25-
<ion-input placeholder="Placeholder"></ion-input>
23+
<ion-input label="Item disabled with Input" placeholder="Placeholder"></ion-input>
2624
</ion-item>
2725

2826
<ion-item>
29-
<ion-label>Item with Input disabled</ion-label>
30-
<ion-input placeholder="Placeholder" disabled></ion-input>
27+
<ion-input label="Item with Input disabled" placeholder="Placeholder" disabled></ion-input>
3128
</ion-item>
3229

3330
<ion-item>
34-
<ion-label position="floating">Item with Select</ion-label>
35-
<ion-select>
31+
<ion-select label="Item with Select" label-placement="floating">
3632
<ion-select-option value="">No Game Console</ion-select-option>
3733
<ion-select-option value="nes">NES</ion-select-option>
3834
<ion-select-option value="n64" selected>Nintendo64</ion-select-option>
@@ -44,8 +40,7 @@ <h1>Item</h1>
4440
</ion-item>
4541

4642
<ion-item disabled>
47-
<ion-label position="floating">Item disabled with Select</ion-label>
48-
<ion-select>
43+
<ion-select label="Item disabled with Select" label-placement="floating">
4944
<ion-select-option value="">No Game Console</ion-select-option>
5045
<ion-select-option value="nes">NES</ion-select-option>
5146
<ion-select-option value="n64" selected>Nintendo64</ion-select-option>
@@ -57,8 +52,7 @@ <h1>Item</h1>
5752
</ion-item>
5853

5954
<ion-item>
60-
<ion-label position="floating">Item with Select disabled</ion-label>
61-
<ion-select disabled>
55+
<ion-select label="Item with Select disabled" label-placement="floating" disabled>
6256
<ion-select-option value="">No Game Console</ion-select-option>
6357
<ion-select-option value="nes">NES</ion-select-option>
6458
<ion-select-option value="n64" selected>Nintendo64</ion-select-option>
@@ -70,33 +64,27 @@ <h1>Item</h1>
7064
</ion-item>
7165

7266
<ion-item>
73-
<ion-label>Item with Toggle</ion-label>
74-
<ion-toggle slot="end"></ion-toggle>
67+
<ion-toggle>Item with Toggle</ion-toggle>
7568
</ion-item>
7669

7770
<ion-item disabled>
78-
<ion-label>Item disabled with Toggle</ion-label>
79-
<ion-toggle slot="end"></ion-toggle>
71+
<ion-toggle>Item disabled with Toggle</ion-toggle>
8072
</ion-item>
8173

8274
<ion-item>
83-
<ion-label>Item with Toggle disabled</ion-label>
84-
<ion-toggle slot="end" disabled></ion-toggle>
75+
<ion-toggle disabled>Item with Toggle disabled</ion-toggle>
8576
</ion-item>
8677

8778
<ion-item>
88-
<ion-label>Item with Radio</ion-label>
89-
<ion-radio slot="start" value="biff"></ion-radio>
79+
<ion-radio value="biff">Item with Radio</ion-radio>
9080
</ion-item>
9181

9282
<ion-item disabled>
93-
<ion-label>Item disabled with Radio</ion-label>
94-
<ion-radio slot="start" value="biff"></ion-radio>
83+
<ion-radio value="biff">Item disabled with Radio</ion-radio>
9584
</ion-item>
9685

9786
<ion-item>
98-
<ion-label>Item with Radio disabled</ion-label>
99-
<ion-radio slot="start" value="biff" disabled></ion-radio>
87+
<ion-radio value="biff" disabled>Item with Radio disabled</ion-radio>
10088
</ion-item>
10189
</main>
10290
</body>

core/src/components/item/test/basic/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ <h4>H4 Title Text</h4>
9898
</ion-item>
9999

100100
<ion-item class="overflow-visible">
101-
<ion-label position="fixed">PIN:</ion-label>
102101
<ion-input
102+
label="PIN:"
103+
label-placement="fixed"
103104
type="number"
104105
pattern="[0-9]*"
105106
inputmode="numeric"
79 Bytes
Loading
10 Bytes
Loading
0 Bytes
Loading
110 Bytes
Loading
22 Bytes
Loading

0 commit comments

Comments
 (0)