From 18e2010b219c8922569185753d7a96b014626919 Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Sun, 18 Jun 2023 12:10:27 +0200 Subject: [PATCH] feat(xml-formatter): added happy path e2e tests --- .../xml-formatter/xml-formatter.e2e.spec.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/tools/xml-formatter/xml-formatter.e2e.spec.ts diff --git a/src/tools/xml-formatter/xml-formatter.e2e.spec.ts b/src/tools/xml-formatter/xml-formatter.e2e.spec.ts new file mode 100644 index 00000000..f09a7864 --- /dev/null +++ b/src/tools/xml-formatter/xml-formatter.e2e.spec.ts @@ -0,0 +1,23 @@ +import { expect, test } from '@playwright/test'; + +test.describe('Tool - Xml formatter', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/xml-formatter'); + }); + + test('Has correct title', async ({ page }) => { + await expect(page).toHaveTitle('Xml formatter - IT Tools'); + }); + + test('XML is converted into a human readable format', async ({ page }) => { + await page.getByTestId('input').fill('bazbaz'); + + const formattedXml = await page.getByTestId('area-content').innerText(); + + expect(formattedXml.trim()).toEqual(` + + baz + baz +`.trim()); + }); +});