mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 06:17:11 -04:00
feat(new tool): xml formatter (#457)
* feat(new tool): xml formatter * feat(xml-formatter): added happy path e2e tests * refactor(xml-formatter): improved unit tests * refactor(xml-formatter): add better suitable icon * feat(xml-formatter): added happy path e2e tests * feat(xml-formatter): registered xml as syntax highlighter * chore(auto-import): removed unused NSpace --------- Co-authored-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
This commit is contained in:
parent
f771e7a99f
commit
a6bbeaebd8
10 changed files with 156 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