feat(xml-formatter): added happy path e2e tests
This commit is contained in:
parent
a8fe517691
commit
18e2010b21
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…
Reference in New Issue
Block a user