fix tests
This commit is contained in:
@@ -47,7 +47,7 @@ test.describe('Nodes', () => {
|
||||
|
||||
test('selectable=false prevents selection', async ({ page }) => {
|
||||
const locator = page.locator(`.${FRAMEWORK}-flow__node`).and(page.locator('[data-id="notSelectable"]'));
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__nodes`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__node`).first()).toHaveCSS('visibility', 'visible');
|
||||
await locator.click();
|
||||
|
||||
await expect(locator).not.toHaveClass(/selected/);
|
||||
@@ -165,7 +165,7 @@ test.describe('Nodes', () => {
|
||||
const outputSourceHandle = page.locator(`.${FRAMEWORK}-flow__handle`).and(page.locator('[data-nodeid="Node-1"]'));
|
||||
const inputSourceHandle = page.locator(`.${FRAMEWORK}-flow__handle`).and(page.locator('[data-nodeid="Node-4"]'));
|
||||
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__nodes`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__node`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(outputSourceHandle).toBeInViewport();
|
||||
await expect(inputSourceHandle).toBeInViewport();
|
||||
|
||||
@@ -189,7 +189,7 @@ test.describe('Nodes', () => {
|
||||
const firstOutputHandle = page.locator(`.${FRAMEWORK}-flow__handle`).and(page.locator('[data-nodeid="Node-2"]'));
|
||||
const secondOutputHandle = page.locator(`.${FRAMEWORK}-flow__handle`).and(page.locator('[data-nodeid="Node-4"]'));
|
||||
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__nodes`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__node`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(firstOutputHandle).toBeInViewport();
|
||||
await expect(secondOutputHandle).toBeInViewport();
|
||||
|
||||
@@ -220,7 +220,7 @@ test.describe('Nodes', () => {
|
||||
.and(page.locator('[data-nodeid="Node-3"]'))
|
||||
.and(page.locator('.source'));
|
||||
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__nodes`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__node`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(firstInputHandle).toBeInViewport();
|
||||
await expect(secondInputHandle).toBeInViewport();
|
||||
|
||||
@@ -251,7 +251,7 @@ test.describe('Nodes', () => {
|
||||
|
||||
const notConnectableBox = await notConnectableHandle.boundingBox();
|
||||
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__nodes`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__node`).first()).toHaveCSS('visibility', 'visible');
|
||||
await expect(outputHandle).toBeInViewport();
|
||||
await expect(notConnectableHandle).toBeInViewport();
|
||||
|
||||
|
||||
@@ -6,17 +6,19 @@ test.describe('Props', () => {
|
||||
test.describe('colorMode', async () => {
|
||||
test('render default light color mode', async ({ page }) => {
|
||||
await page.goto('/examples/color-mode');
|
||||
const locator = page.locator(`.${FRAMEWORK}-flow`);
|
||||
|
||||
await expect(locator).not.toHaveClass(/dark/);
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__node`).first()).toHaveCSS('visibility', 'visible');
|
||||
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow`)).not.toHaveClass(/dark/);
|
||||
});
|
||||
|
||||
test('render dark color mode', async ({ page }) => {
|
||||
await page.goto('/examples/color-mode');
|
||||
const locator = page.locator(`.${FRAMEWORK}-flow`);
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow__node`).first()).toHaveCSS('visibility', 'visible');
|
||||
|
||||
await page.getByTestId('colormode-select').selectOption({ label: 'dark' });
|
||||
|
||||
await expect(locator).toHaveClass(/dark/);
|
||||
await expect(page.locator(`.${FRAMEWORK}-flow`)).toHaveClass(/dark/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
837
tests/playwright/package-lock.json
generated
837
tests/playwright/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,11 +14,11 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.49.1",
|
||||
"@playwright/test": "^1.51.1",
|
||||
"@types/node": "^20.14.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@playwright/experimental-ct-react": "^1.49.1",
|
||||
"@playwright/experimental-ct-react": "^1.51.1",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"react": "^18.3.1",
|
||||
|
||||
Reference in New Issue
Block a user