aboutsummaryrefslogtreecommitdiff
path: root/src/tools/xml-formatter/xml-formatter.e2e.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/xml-formatter/xml-formatter.e2e.spec.ts')
-rw-r--r--src/tools/xml-formatter/xml-formatter.e2e.spec.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/xml-formatter/xml-formatter.e2e.spec.ts b/src/tools/xml-formatter/xml-formatter.e2e.spec.ts
new file mode 100644
index 0000000..11fbbd8
--- /dev/null
+++ b/src/tools/xml-formatter/xml-formatter.e2e.spec.ts
@@ -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());
+ });
+});