mirror of
https://github.com/Art051/it-tools.git
synced 2025-08-11 19:29:03 +00:00
feat(new-tool): yaml to toml
This commit is contained in:
committed by
Corentin THOMASSET
parent
ea50a3fc65
commit
e29b258e90
37
src/tools/yaml-to-toml/yaml-to-toml.e2e.spec.ts
Normal file
37
src/tools/yaml-to-toml/yaml-to-toml.e2e.spec.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('Tool - YAML to TOML', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/yaml-to-toml');
|
||||
});
|
||||
|
||||
test('Has correct title', async ({ page }) => {
|
||||
await expect(page).toHaveTitle('YAML 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
|
||||
number: 1
|
||||
`.trim());
|
||||
|
||||
const generatedJson = await page.getByTestId('area-content').innerText();
|
||||
|
||||
expect(generatedJson.trim()).toEqual(
|
||||
`
|
||||
foo = "bar"
|
||||
|
||||
[list]
|
||||
name = "item"
|
||||
|
||||
[list.another]
|
||||
key = "value"
|
||||
number = 1
|
||||
`.trim(),
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user