-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core):
Textfield
should not change color of chevron on hover if…
… `readOnly` is enabled (#8754)
- Loading branch information
1 parent
fcca2fa
commit 2e21615
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
projects/demo-playwright/tests/core/textfield/textfield.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {DemoRoute} from '@demo/routes'; | ||
import {TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils'; | ||
import {expect, type Locator, test} from '@playwright/test'; | ||
|
||
test.describe('Textfield', () => { | ||
test.describe('interactivity on hover', () => { | ||
let example!: Locator; | ||
|
||
test.beforeEach(async ({page}) => { | ||
await tuiGoto(page, DemoRoute.Textfield); | ||
example = new TuiDocumentationPagePO(page).getExample('#states'); | ||
}); | ||
|
||
test('disable state', async () => { | ||
const textfield = example.locator('tui-textfield:has(input:disabled)'); | ||
|
||
await textfield.hover({force: true}); | ||
|
||
await expect(example).toHaveScreenshot('textfield-disabled-hover.png'); | ||
}); | ||
|
||
test('readonly state', async () => { | ||
const textfield = example.locator('tui-textfield:has(input:read-only)', { | ||
hasText: 'Read-only', | ||
}); | ||
|
||
await textfield.hover(); | ||
|
||
await expect(example).toHaveScreenshot('textfield-readonly-hover.png'); | ||
}); | ||
|
||
test('invalid state', async () => { | ||
const textfield = example.locator('tui-textfield', { | ||
hasText: 'Invalid', | ||
}); | ||
|
||
await textfield.hover(); | ||
|
||
await expect(example).toHaveScreenshot('textfield-invalid-hover.png'); | ||
}); | ||
}); | ||
}); |