Skip to content

Commit

Permalink
fix: biome formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
barbmarcio committed Jul 19, 2024
1 parent 9cf52ab commit 1abb288
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 60 deletions.
63 changes: 33 additions & 30 deletions e2e/auctions.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { apis, baseURL } from '../src/constants/apis.constant';
import { test, expect } from '@playwright/test'
import { expect, test } from "@playwright/test";
import { apis, baseURL } from "../src/constants/apis.constant";

test.describe('Create Auction via Topsort.js', () => {
test('should create auction successfully', async ({ page }) => {
test.describe("Create Auction via Topsort.js", () => {
test("should create auction successfully", async ({ page }) => {
const mockAPIResponse = {
results: [
{
Expand All @@ -16,39 +16,42 @@ test.describe('Create Auction via Topsort.js', () => {
error: false,
},
],
}
};

await page.route(`${baseURL}/${apis.auctions}`, async route => {
await page.route(`${baseURL}/${apis.auctions}`, async (route) => {
await route.fulfill({ json: mockAPIResponse });
});

await page.goto('http://localhost:8080/e2e/index.html');
await page.goto("http://localhost:8080/e2e/index.html");

await page.fill('input[name="apiKey"]', 'your-api-key');
await page.fill('input[name="auctionDetails"]', JSON.stringify({
auctions: [
{
type: "listings",
slots: 3,
category: { id: "cat123" },
geoTargeting: { location: "US" },
},
{
type: "banners",
slots: 1,
device: "desktop",
slotId: "slot123",
category: { ids: ["cat1", "cat2"] },
geoTargeting: { location: "UK" },
},
],
}));
await page.fill('input[name="apiKey"]', "your-api-key");
await page.fill(
'input[name="auctionDetails"]',
JSON.stringify({
auctions: [
{
type: "listings",
slots: 3,
category: { id: "cat123" },
geoTargeting: { location: "US" },
},
{
type: "banners",
slots: 1,
device: "desktop",
slotId: "slot123",
category: { ids: ["cat1", "cat2"] },
geoTargeting: { location: "UK" },
},
],
}),
);

await page.click('button[type="submit"]');

const response = await page.locator('#response').textContent();
const jsonResponse = JSON.parse(response || '{}');
expect(jsonResponse).toEqual(mockAPIResponse)
const response = await page.locator("#response").textContent();
const jsonResponse = JSON.parse(response || "{}");
expect(jsonResponse).toEqual(mockAPIResponse);
expect(jsonResponse).toEqual(mockAPIResponse);
});
});
});
58 changes: 29 additions & 29 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { defineConfig, devices } from '@playwright/test';
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
testDir: './e2e',
timeout: 30000,
retries: 1,
testMatch: '**/*.spec.ts',
reporter: [['list'], ['json', { outputFile: 'test-results.json' }]],
use: {
trace: 'on-first-retry',
testDir: "./e2e",
timeout: 30000,
retries: 1,
testMatch: "**/*.spec.ts",
reporter: [["list"], ["json", { outputFile: "test-results.json" }]],
use: {
trace: "on-first-retry",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
webServer: {
command: 'http-server ./ -p 8080',
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe',
}
})
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
],
webServer: {
command: "http-server ./ -p 8080",
reuseExistingServer: !process.env.CI,
stdout: "ignore",
stderr: "pipe",
},
});
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default defineConfig({
minify: true,
esbuildOptions(options) {
options.keepNames = true;
options.globalName = "Topsort"
options.globalName = "Topsort";
},
});

0 comments on commit 1abb288

Please sign in to comment.