mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 14:27:11 -04:00
feat(new-tool): toml to yaml
This commit is contained in:
parent
c7d4f112c0
commit
746e5bdccc
4 changed files with 77 additions and 0 deletions
36
src/tools/toml-to-yaml/toml-to-yaml.e2e.spec.ts
Normal file
36
src/tools/toml-to-yaml/toml-to-yaml.e2e.spec.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('Tool - TOML to YAML', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/toml-to-yaml');
|
||||
});
|
||||
|
||||
test('Has correct title', async ({ page }) => {
|
||||
await expect(page).toHaveTitle('TOML to YAML - IT Tools');
|
||||
});
|
||||
|
||||
test('TOML is parsed and outputs clean YAML', async ({ page }) => {
|
||||
await page.getByTestId('input').fill(`
|
||||
foo = "bar"
|
||||
|
||||
# This is a comment
|
||||
|
||||
[list]
|
||||
name = "item"
|
||||
[list.another]
|
||||
key = "value"
|
||||
`.trim());
|
||||
|
||||
const generatedJson = await page.getByTestId('area-content').innerText();
|
||||
|
||||
expect(generatedJson.trim()).toEqual(
|
||||
`
|
||||
foo: bar
|
||||
list:
|
||||
name: item
|
||||
another:
|
||||
key: value
|
||||
`.trim(),
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue