diff --git a/__tests__/register.test.jsx b/__tests__/register.test.jsx deleted file mode 100644 index 027c3e5..0000000 --- a/__tests__/register.test.jsx +++ /dev/null @@ -1,70 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test("inscription avec nom d'utilisateur déjà existant", async ({ page }) => { - await page.goto('http://localhost:3001/register'); -await page.fill('input[placeholder="username"]', 'utilisateur_existant'); -await page.fill('input[placeholder="password"]', 'mot_de_passe_test'); -await page.fill('input[placeholder="confirmation"]', 'mot_de_passe_test'); -await page.click('button[type="submit"]'); -await page.waitForLoadState('networkidle'); -const errorMessage = await page.textContent('.text-red-500'); -expect(errorMessage).toContain("Ce nom d'utilisateur existe déjà"); -}); - -test("inscription avec mots de passe non correspondants", async ({ page }) => { - await page.goto('http://localhost:3001/register'); - await page.fill('input[placeholder="username"]', 'utilisateur_test'); - await page.fill('input[placeholder="password"]', 'mot_de_passe_test'); - await page.fill('input[placeholder="confirmation"]', 'mot_de_passe_incorrect'); - await page.click('button[type="submit"]'); - await page.waitForLoadState('networkidle'); - const errorMessage = await page.textContent('.text-red-500'); - expect(errorMessage).toContain('Les mots de passe ne correspondent pas'); -}); - -test("inscription sans nom d'utilisateur", async ({ page }) => { - await page.goto('http://localhost:3001/register'); -await page.fill('input[placeholder="password"]', 'mot_de_passe_test'); -await page.fill('input[placeholder="confirmation"]', 'mot_de_passe_test'); -await page.click('button[type="submit"]'); -await page.waitForLoadState('networkidle'); -const errorMessage = await page.textContent('.text-red-500'); -expect(errorMessage).toContain("Veuillez fournir un nom d'utilisateur"); -}); - -//describe("Register Component", () => { - - -// it("inscription avec nom d'utilisateur déjà existant", async ({ page }) => { -// await page.goto('http://localhost:3001/register'); -// await page.fill('input[placeholder="username"]', 'utilisateur_existant'); -// await page.fill('input[placeholder="password"]', 'mot_de_passe_test'); -// await page.fill('input[placeholder="confirmation"]', 'mot_de_passe_test'); -// await page.click('button[type="submit"]'); -// await page.waitForLoadState('networkidle'); -// const errorMessage = await page.textContent('.text-red-500'); -// expect(errorMessage).toContain("Ce nom d'utilisateur existe déjà"); -// }); - -// it("inscription avec mots de passe non correspondants", async ({ page }) => { -// await page.goto('http://localhost:3001/register'); -// await page.fill('input[placeholder="username"]', 'utilisateur_test'); -// await page.fill('input[placeholder="password"]', 'mot_de_passe_test'); -// await page.fill('input[placeholder="confirmation"]', 'mot_de_passe_incorrect'); -// await page.click('button[type="submit"]'); -// await page.waitForLoadState('networkidle'); -// const errorMessage = await page.textContent('.text-red-500'); -// expect(errorMessage).toContain('Les mots de passe ne correspondent pas'); -// }); - -// it("inscription sans nom d'utilisateur", async ({ page }) => { -// await page.goto('http://localhost:3001/register'); -// await page.fill('input[placeholder="password"]', 'mot_de_passe_test'); -// await page.fill('input[placeholder="confirmation"]', 'mot_de_passe_test'); -// await page.click('button[type="submit"]'); -// await page.waitForLoadState('networkidle'); -// const errorMessage = await page.textContent('.text-red-500'); -// expect(errorMessage).toContain("Veuillez fournir un nom d'utilisateur"); -// }); - -//}); \ No newline at end of file