2023-05-28 23:13:24 +02:00
|
|
|
import { expect, test } from '@playwright/test';
|
2023-04-10 17:34:58 +02:00
|
|
|
|
|
|
|
test.describe('Tool - json to yaml', () => {
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
await page.goto('/json-to-yaml-converter');
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Has correct title', async ({ page }) => {
|
|
|
|
await expect(page).toHaveTitle('JSON to YAML converter - IT Tools');
|
|
|
|
});
|
|
|
|
|
|
|
|
test('json is parsed and output clean yaml', async ({ page }) => {
|
|
|
|
await page.getByTestId('input').fill('{"foo":"bar","list":["item",{"key":"value"}]}');
|
|
|
|
|
|
|
|
const generatedJson = await page.getByTestId('area-content').innerText();
|
|
|
|
|
2023-05-28 23:13:24 +02:00
|
|
|
expect(generatedJson.trim()).toEqual('foo: bar\nlist:\n - item\n - key: value'.trim());
|
2023-04-10 17:34:58 +02:00
|
|
|
});
|
|
|
|
});
|