Skip to content

Commit 592527e

Browse files
committed
test(input): update assertions
1 parent 41ea84c commit 592527e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/src/components/input/test/bottom-content/input.e2e.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
130130

131131
const input = page.locator('ion-input input');
132132

133-
await expect(input).toHaveAttribute('aria-invalid', '');
133+
await expect(input).toHaveAttribute('aria-invalid');
134134
});
135135
test('input should not have aria-invalid attribute when input is valid', async ({ page }) => {
136136
await page.setContent(
@@ -139,19 +139,17 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
139139
);
140140

141141
const input = page.locator('ion-input input');
142-
const ariaInvalid = await input.getAttribute('aria-invalid');
143142

144-
expect(ariaInvalid).toBe(null);
143+
await expect(input).not.toHaveAttribute('aria-invalid');
145144
});
146145
test('input should not have aria-describedby attribute when no hint or error text is present', async ({
147146
page,
148147
}) => {
149148
await page.setContent(`<ion-input label="my input"></ion-input>`, config);
150149

151150
const input = page.locator('ion-input input');
152-
const ariaDescribedBy = await input.getAttribute('aria-describedby');
153151

154-
expect(ariaDescribedBy).toBe(null);
152+
await expect(input).not.toHaveAttribute('aria-describedby');
155153
});
156154
});
157155
test.describe('input: hint text rendering', () => {

0 commit comments

Comments
 (0)