mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-12 00:51:33 -04:00
feat(new-tool): yaml and json converters
This commit is contained in:
parent
05f06f6a07
commit
c0a89131dd
9 changed files with 149 additions and 1 deletions
19
src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts
Normal file
19
src/tools/json-to-yaml-converter/json-to-yaml.e2e.spec.ts
Normal file
|
@ -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());
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue