2026-04-10

- corvée: met à jour les deps
- corvée: formate
This commit is contained in:
gcch 2026-04-10 17:21:57 +02:00
commit b2a0012590
85 changed files with 132083 additions and 31328 deletions

View file

@ -1,11 +1,13 @@
import { test as base, expect, Response } from "@playwright/test";
import {
import type { Response } from "@playwright/test";
import { expect, test as base } from "@playwright/test";
import { pipe } from "effect";
import { not } from "effect/Boolean";
import type {
WCV3Product,
WCV3Products,
} from "../../web/app/themes/haiku-atelier-2024/src/scripts/lib/types/api/v3/products";
import { BackendHeaders, getBackendHeadersFromHtml } from "./utils.ts";
import { pipe } from "effect";
import { not } from "effect/Boolean";
import type { BackendHeaders } from "./utils.ts";
import { getBackendHeadersFromHtml } from "./utils.ts";
/*
* Faire un premier test simple l'on clic sur la première carte du shop
@ -30,7 +32,7 @@ type ProductsKinds = {
export const test = base.extend<ProductsFixture>({
products: async ({ page, request }, use) => {
await page.goto("/shop");
await page["goto"]("/shop");
const backendHeaders: BackendHeaders = await getBackendHeadersFromHtml(page);
const response = await request.get("/wp-json/wc/v3/products?page=1&per_page=100&status=publish", {
@ -68,7 +70,7 @@ test("can add a Product without variation with stock to the Cart", async ({ page
}
// Va à la page du Produit.
await page.goto(randomProduct.permalink);
await page["goto"](randomProduct.permalink);
// Vérifie le bon état du bouton de l'ajout au Panier.
const addToCartButton = page.getByRole("button", { disabled: false, name: "Add to cart" });
@ -101,7 +103,7 @@ test("can't add a Product without variation without stock to the Cart", async ({
}
// Va à la page du Produit.
await page.goto(randomProduct.permalink);
await page["goto"](randomProduct.permalink);
// Vérifie le bon état du bouton de l'ajout au Panier.
const outOfStockButton = page.getByRole("button", { disabled: true, name: "Out of stock" });