Skip to content

Commit

Permalink
fix: some more linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cskiwi committed Feb 26, 2024
1 parent 68ccb64 commit 5d328ff
Show file tree
Hide file tree
Showing 5 changed files with 1,094 additions and 640 deletions.
2 changes: 1 addition & 1 deletion apps/badman-e2e/src/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type testFixture = {
homePage: HomePage;
assemblyPage: AssemblyPage;
};
export const bTest = base.extend<testFixture>({
export const test = base.extend<testFixture>({
homePage: async ({ page }, use) => {
const homePage = new HomePage(page);
await homePage.goto();
Expand Down
14 changes: 7 additions & 7 deletions apps/badman-e2e/src/tests/assembly.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect } from '@playwright/test';
import { bTest } from '../fixture';
import { test } from '../fixture';
import { TestNames } from '@badman/utils';

const players = TestNames.BCBroodrooster.players;

bTest.describe('AssemblyPage page', () => {
bTest('if page is visible', async ({ assemblyPage }) => {
test.describe('AssemblyPage page', () => {
test('if page is visible', async ({ assemblyPage }) => {
await expect(assemblyPage.header).toContainText('Team assembly');

// Check if all the types are correct
Expand All @@ -20,8 +20,8 @@ bTest.describe('AssemblyPage page', () => {
expect(players.F8).toBe('F 8-8-8 BC Broodrooster');
});

bTest.describe('Assembly', () => {
bTest('Mixed assembly', async ({ assemblyPage }) => {
test.describe('Assembly', () => {
test('Mixed assembly', async ({ assemblyPage }) => {
await assemblyPage.selectClub(TestNames.BCBroodrooster.name);
await assemblyPage.selectTeam(TestNames.BCBroodrooster.teams.G1);

Expand Down Expand Up @@ -98,7 +98,7 @@ bTest.describe('AssemblyPage page', () => {
await expect(assemblyPage.single4List).toContainText(players.F7);
});

bTest('Males assembly', async ({ assemblyPage }) => {
test('Males assembly', async ({ assemblyPage }) => {
expect(TestNames.BCBroodrooster.name).toBeDefined();
expect(TestNames.BCBroodrooster.teams.M1).toBeDefined();

Expand Down Expand Up @@ -170,7 +170,7 @@ bTest.describe('AssemblyPage page', () => {
);
});

bTest('Females assembly', async ({ assemblyPage }) => {
test('Females assembly', async ({ assemblyPage }) => {
expect(TestNames.BCBroodrooster.name).toBeDefined();
expect(TestNames.BCBroodrooster.teams.F1).toBeDefined();

Expand Down
4 changes: 2 additions & 2 deletions apps/badman-e2e/src/tests/landing.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from '@playwright/test';
import { bTest } from '../fixture';
import { test } from '../fixture';

bTest('Landing page', async ({ homePage }) => {
test('Landing page', async ({ homePage }) => {
// if page is visible
await expect(homePage.ranking).toBeVisible();

Expand Down
6 changes: 5 additions & 1 deletion apps/badman-e2e/src/utils/dragDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const dragDrop = async (page: Page, originElement: Locator, destinationEl

await originElement.hover();
await page.mouse.down();
const box = (await destinationElement.boundingBox())!;
const box = await destinationElement.boundingBox();
if (!box) {
throw new Error('Destination element is not visible');
}

await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
await destinationElement.hover();
await page.mouse.up();
Expand Down
Loading

0 comments on commit 5d328ff

Please sign in to comment.