diff options
Diffstat (limited to 'src/tools/yaml-to-json-converter/yaml-to-json.e2e.spec.ts')
-rw-r--r-- | src/tools/yaml-to-json-converter/yaml-to-json.e2e.spec.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tools/yaml-to-json-converter/yaml-to-json.e2e.spec.ts b/src/tools/yaml-to-json-converter/yaml-to-json.e2e.spec.ts new file mode 100644 index 0000000..10db449 --- /dev/null +++ b/src/tools/yaml-to-json-converter/yaml-to-json.e2e.spec.ts @@ -0,0 +1,31 @@ +import { test, expect } from '@playwright/test'; + +test.describe('Tool - Yaml to json', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/yaml-to-json-converter'); + }); + + test('Has correct title', async ({ page }) => { + await expect(page).toHaveTitle('YAML to JSON converter - IT Tools'); + }); + + test('Yaml is parsed and output clean json', async ({ page }) => { + await page.getByTestId('input').fill('foo: bar\nlist:\n - item\n - key: value'); + + const generatedJson = await page.getByTestId('area-content').innerText(); + + expect(generatedJson.trim()).toEqual( + ` +{ + "foo": "bar", + "list": [ + "item", + { + "key": "value" + } + ] +} + `.trim(), + ); + }); +}); |