-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3325bf
commit 07712a6
Showing
2 changed files
with
49 additions
and
49 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
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 |
---|---|---|
@@ -1,48 +1,48 @@ | ||
import { expect, test } from '@playwright/test' | ||
|
||
const path = '/iframe.html?id=cascaderinput--defalut&viewMode=story' | ||
test('default value', async ({ page }) => { | ||
await page.goto(path) | ||
|
||
const input = page.locator('input') | ||
await expect(input).toHaveValue('children-1') | ||
}) | ||
|
||
test('use value as placeholder when focused', async ({ page }) => { | ||
await page.goto(path) | ||
|
||
const input = page.locator('input') | ||
await input.focus() | ||
|
||
await expect(input).toHaveValue('') | ||
await expect(input).toHaveAttribute('placeholder', 'children-1') | ||
|
||
page.click('body') | ||
await expect(input).toHaveValue('children-1') | ||
}) | ||
|
||
test('select leaf', async ({ page }) => { | ||
await page.goto(path) | ||
|
||
const input = page.locator('input') | ||
|
||
await input.click() | ||
|
||
const item = page.locator('//span[text()="parent-1"]') | ||
await item.click() | ||
|
||
await expect(input).toHaveValue('parent-1') | ||
}) | ||
|
||
test('render node', async ({ page }) => { | ||
await page.goto(path) | ||
|
||
const input = page.locator('input') | ||
|
||
await input.click() | ||
|
||
const li = page.locator('.MuiChip-label') | ||
|
||
await expect(li.first()).toHaveText('100') | ||
await expect(li.nth(1)).toHaveText('10') | ||
}) | ||
// import { expect, test } from '@playwright/test' | ||
// | ||
// const path = '/iframe.html?id=cascaderinput--defalut&viewMode=story' | ||
// test('default value', async ({ page }) => { | ||
// await page.goto(path) | ||
// | ||
// const input = page.locator('input') | ||
// await expect(input).toHaveValue('children-1') | ||
// }) | ||
// | ||
// test('use value as placeholder when focused', async ({ page }) => { | ||
// await page.goto(path) | ||
// | ||
// const input = page.locator('input') | ||
// await input.focus() | ||
// | ||
// await expect(input).toHaveValue('') | ||
// await expect(input).toHaveAttribute('placeholder', 'children-1') | ||
// | ||
// page.click('body') | ||
// await expect(input).toHaveValue('children-1') | ||
// }) | ||
// | ||
// test('select leaf', async ({ page }) => { | ||
// await page.goto(path) | ||
// | ||
// const input = page.locator('input') | ||
// | ||
// await input.click() | ||
// | ||
// const item = page.locator('//span[text()="parent-1"]') | ||
// await item.click() | ||
// | ||
// await expect(input).toHaveValue('parent-1') | ||
// }) | ||
// | ||
// test('render node', async ({ page }) => { | ||
// await page.goto(path) | ||
// | ||
// const input = page.locator('input') | ||
// | ||
// await input.click() | ||
// | ||
// const li = page.locator('.MuiChip-label') | ||
// | ||
// await expect(li.first()).toHaveText('100') | ||
// await expect(li.nth(1)).toHaveText('10') | ||
// }) |