mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
chore: update tests
This commit is contained in:
@@ -5,6 +5,10 @@ import sinon from 'sinon';
|
||||
import type SlCarousel from './carousel';
|
||||
|
||||
describe('<sl-carousel>', () => {
|
||||
afterEach(async () => {
|
||||
await resetMouse();
|
||||
});
|
||||
|
||||
it('should render a carousel with default configuration', async () => {
|
||||
// Arrange
|
||||
const el = await fixture(html`
|
||||
@@ -307,13 +311,16 @@ describe('<sl-carousel>', () => {
|
||||
const carouselItem = el.querySelector('sl-carousel-item') as HTMLElement;
|
||||
|
||||
// Act
|
||||
await moveMouseOnElement(carouselItem, 'center');
|
||||
await moveMouseOnElement(carouselItem, 'right');
|
||||
await sendMouse({
|
||||
type: 'down'
|
||||
});
|
||||
await moveMouseOnElement(carouselItem, 'center', -10);
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
await moveMouseOnElement(carouselItem, 'center', -carouselItem.offsetWidth);
|
||||
|
||||
// For some reason it seems necessary to move the mouse back and forth to trigger a move event
|
||||
await moveMouseOnElement(carouselItem, 'left');
|
||||
await moveMouseOnElement(carouselItem, 'right');
|
||||
await moveMouseOnElement(carouselItem, 'left');
|
||||
|
||||
await sendMouse({
|
||||
type: 'up'
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import { playwrightLauncher } from '@web/test-runner-playwright';
|
||||
export default {
|
||||
rootDir: '.',
|
||||
files: 'src/**/*.test.ts', // "default" group
|
||||
concurrentBrowsers: 1,
|
||||
concurrentBrowsers: 3,
|
||||
nodeResolve: true,
|
||||
testFramework: {
|
||||
config: {
|
||||
|
||||
Reference in New Issue
Block a user