feat(xml-formatter): added happy path e2e tests

This commit is contained in:
Corentin Thomasset 2023-06-18 12:10:27 +02:00
parent a8fe517691
commit 18e2010b21
No known key found for this signature in database
GPG key ID: DBD997E935996158

View file

@ -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('<foo><bar>baz</bar><bar>baz</bar></foo>');
const formattedXml = await page.getByTestId('area-content').innerText();
expect(formattedXml.trim()).toEqual(`
<foo>
<bar>baz</bar>
<bar>baz</bar>
</foo>`.trim());
});
});