fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled
Some checks failed
Deploy Application / deploy (push) Has been cancelled
This commit is contained in:
90
tests/e2e/live-components/scroll-behavior.spec.ts
Normal file
90
tests/e2e/live-components/scroll-behavior.spec.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
/**
|
||||
* LiveComponents: Scroll Behavior Tests
|
||||
*
|
||||
* Tests automatic scrolling after updates
|
||||
*/
|
||||
test.describe('LiveComponents Scroll Behavior', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/');
|
||||
});
|
||||
|
||||
test('should support scroll after update', async ({ page }) => {
|
||||
const scrollButton = page.locator('[data-lc-scroll="true"]').first();
|
||||
const count = await scrollButton.count();
|
||||
|
||||
if (count === 0) {
|
||||
test.skip();
|
||||
return;
|
||||
}
|
||||
|
||||
// Scroll to top first
|
||||
await page.evaluate(() => window.scrollTo(0, 0));
|
||||
|
||||
// Click button
|
||||
await scrollButton.click();
|
||||
|
||||
// Wait for update and scroll
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Button should still be visible
|
||||
expect(scrollButton).toBeVisible();
|
||||
});
|
||||
|
||||
test('should support scroll-target', async ({ page }) => {
|
||||
const scrollTargetButton = page.locator('[data-lc-scroll-target]').first();
|
||||
const count = await scrollTargetButton.count();
|
||||
|
||||
if (count === 0) {
|
||||
test.skip();
|
||||
return;
|
||||
}
|
||||
|
||||
const targetSelector = await scrollTargetButton.getAttribute('data-lc-scroll-target');
|
||||
if (!targetSelector) {
|
||||
test.skip();
|
||||
return;
|
||||
}
|
||||
|
||||
const targetElement = page.locator(targetSelector).first();
|
||||
const targetExists = await targetElement.count() > 0;
|
||||
|
||||
if (!targetExists) {
|
||||
test.skip();
|
||||
return;
|
||||
}
|
||||
|
||||
// Click button
|
||||
await scrollTargetButton.click();
|
||||
|
||||
// Wait for update and scroll
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Target should be visible
|
||||
expect(targetElement).toBeVisible();
|
||||
});
|
||||
|
||||
test('should support scroll-behavior', async ({ page }) => {
|
||||
const smoothScrollButton = page.locator('[data-lc-scroll-behavior="smooth"]').first();
|
||||
const instantScrollButton = page.locator('[data-lc-scroll-behavior="instant"]').first();
|
||||
|
||||
// Test smooth scroll
|
||||
if (await smoothScrollButton.count() > 0) {
|
||||
await smoothScrollButton.click();
|
||||
await page.waitForTimeout(1000);
|
||||
expect(smoothScrollButton).toBeVisible();
|
||||
}
|
||||
|
||||
// Test instant scroll
|
||||
if (await instantScrollButton.count() > 0) {
|
||||
await instantScrollButton.click();
|
||||
await page.waitForTimeout(1000);
|
||||
expect(instantScrollButton).toBeVisible();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user