forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinputs.spec.ts
More file actions
28 lines (23 loc) · 1.08 KB
/
inputs.spec.ts
File metadata and controls
28 lines (23 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { test, expect } from '@playwright/test';
test.describe('Inputs', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/standalone/inputs');
});
test.describe('basic functionality', () => {
test('should reflect props when component has a default value', async ({ page }) => {
// Disable inputs
await page.locator('#disable-button').click();
// Disabled prop
await expect(page.locator('ion-input')).toHaveAttribute('disabled', '');
await expect(page.locator('ion-input-otp')).toHaveAttribute('disabled', '');
await expect(page.locator('ion-textarea')).toHaveAttribute('disabled', '');
// Reset disabled state and set readonly state
await page.locator('#disable-button').click();
await page.locator('#readonly-button').click();
// Readonly prop
await expect(page.locator('ion-input')).toHaveAttribute('readonly', '');
await expect(page.locator('ion-input-otp')).toHaveAttribute('readonly', '');
await expect(page.locator('ion-textarea')).toHaveAttribute('readonly', '');
});
});
});