aboutsummaryrefslogtreecommitdiff
path: root/src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts
diff options
context:
space:
mode:
authorGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2023-04-10 17:34:58 +0200
committerGravatar Corentin THOMASSET <corentin.thomasset74@gmail.com> 2023-04-10 22:38:35 +0200
commitc0a89131dd919c2bb6562cb0de18b1396e12bf23 (patch)
tree42cfe5c700ff2cd5190e8585589ea4f8f697bee5 /src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts
parent05f06f6a072e8421c48ebe7c2bafcbbe056163ed (diff)
downloadit-tools-c0a89131dd919c2bb6562cb0de18b1396e12bf23.tar.gz
it-tools-c0a89131dd919c2bb6562cb0de18b1396e12bf23.tar.zst
it-tools-c0a89131dd919c2bb6562cb0de18b1396e12bf23.zip
feat(new-tool): yaml and json converters
Diffstat (limited to 'src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts')
-rw-r--r--src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts b/src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts
new file mode 100644
index 0000000..bce095b
--- /dev/null
+++ b/src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts
@@ -0,0 +1,19 @@
+import { test, expect } from '@playwright/test';
+
+test.describe('Tool - json to yaml', () => {
+ test.beforeEach(async ({ page }) => {
+ await page.goto('/json-to-yaml-converter');
+ });
+
+ test('Has correct title', async ({ page }) => {
+ await expect(page).toHaveTitle('JSON to YAML converter - IT Tools');
+ });
+
+ test('json is parsed and output clean yaml', async ({ page }) => {
+ await page.getByTestId('input').fill('{"foo":"bar","list":["item",{"key":"value"}]}');
+
+ const generatedJson = await page.getByTestId('area-content').innerText();
+
+ expect(generatedJson.trim()).toEqual(`foo: bar\nlist:\n - item\n - key: value`.trim());
+ });
+});