mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-05 13:57:10 -04:00
feat(new-tool): toml to json
This commit is contained in:
parent
9125dcf9c6
commit
c7d4f112c0
8 changed files with 114 additions and 1 deletions
40
src/tools/toml-to-json/toml-to-json.e2e.spec.ts
Normal file
40
src/tools/toml-to-json/toml-to-json.e2e.spec.ts
Normal file
|
@ -0,0 +1,40 @@
|
|||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('Tool - TOML to JSON', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/toml-to-json');
|
||||
});
|
||||
|
||||
test('Has correct title', async ({ page }) => {
|
||||
await expect(page).toHaveTitle('TOML to JSON - IT Tools');
|
||||
});
|
||||
|
||||
test('TOML is parsed and outputs clean JSON', 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