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

37 lines
742 B
TypeScript
Raw Normal View History

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