mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-08 23:25:03 -04:00
feat(xml-formatter): added happy path e2e tests
This commit is contained in:
parent
a8fe517691
commit
18e2010b21
1 changed files with 23 additions and 0 deletions
23
src/tools/xml-formatter/xml-formatter.e2e.spec.ts
Normal file
23
src/tools/xml-formatter/xml-formatter.e2e.spec.ts
Normal 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());
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue