aboutsummaryrefslogtreecommitdiff
path: root/src/tools/yaml-to-toml/yaml-to-toml.e2e.spec.ts
blob: 5140678c5a6db387b540dc56c6b61485322e6dae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 }) => {
    await expect(page).toHaveTitle('YAML to TOML - IT Tools');
  });

  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(),
    );
  });
});