mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 06:17:11 -04:00
24 lines
654 B
TypeScript
24 lines
654 B
TypeScript
![]() |
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());
|
||
|
});
|
||
|
});
|