aboutsummaryrefslogtreecommitdiff
path: root/src/tools/json-to-toml/json-to-toml.e2e.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/json-to-toml/json-to-toml.e2e.spec.ts')
-rw-r--r--src/tools/json-to-toml/json-to-toml.e2e.spec.ts39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/tools/json-to-toml/json-to-toml.e2e.spec.ts b/src/tools/json-to-toml/json-to-toml.e2e.spec.ts
new file mode 100644
index 0000000..b2f7587
--- /dev/null
+++ b/src/tools/json-to-toml/json-to-toml.e2e.spec.ts
@@ -0,0 +1,39 @@
+import { expect, test } from '@playwright/test';
+
+test.describe('Tool - JSON to TOML', () => {
+ test.beforeEach(async ({ page }) => {
+ await page.goto('/json-to-toml');
+ });
+
+ test('Has correct title', async ({ page }) => {
+ await expect(page).toHaveTitle('JSON to TOML - IT Tools');
+ });
+
+ test('JSON is parsed and outputs clean TOML', async ({ page }) => {
+ await page.getByTestId('input').fill(`
+{
+ "foo": "bar",
+ "list": {
+ "name": "item",
+ "another": {
+ "key": "value"
+ }
+ }
+}
+ `.trim());
+
+ const generatedJson = await page.getByTestId('area-content').innerText();
+
+ expect(generatedJson.trim()).toEqual(
+ `
+foo = "bar"
+
+[list]
+name = "item"
+
+ [list.another]
+ key = "value"
+ `.trim(),
+ );
+ });
+});