it-tools/src/tools/yaml-to-toml/yaml-to-toml.e2e.spec.ts

38 lines
749 B
TypeScript
Raw Normal View History

2023-06-23 21:40:43 +02:00
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 }) => {
2024-04-23 00:08:15 +08:00
await expect(page).toHaveTitle('YAML to TOML - Zeeklog Online Tools');
2023-06-23 21:40:43 +02:00
});
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(),
);
});
});