feat(list-converter): a small converter who deals with column based data and do some stuff with it (#387)

* feat(list-converter): a small converter who deals with column based data and do some stuff with it

* Update src/tools/list-converter/index.ts

* Update src/tools/list-converter/index.ts

* Update src/tools/list-converter/index.ts

---------

Co-authored-by: Corentin THOMASSET <corentin.thomasset74@gmail.com>

fix(list-format): fix e2e
This commit is contained in:
cgoIT
2023-05-07 11:29:22 +02:00
committed by Corentin Thomasset
parent ce3150c65d
commit 83a7b3bae9
9 changed files with 441 additions and 139 deletions

View File

@@ -0,0 +1,39 @@
import { test, expect } from '@playwright/test';
test.describe('Tool - List converter', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/list-converter');
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('List converter - IT Tools');
});
test('Simple list should be converted with default settings', async ({ page }) => {
await page.getByTestId('input').fill(`1
2
3
4
5`);
const result = await page.getByTestId('area-content').innerText();
expect(result.trim()).toEqual('1, 2, 3, 4, 5');
});
test('Duplicates should be removed, list should be sorted and prefix and suffix list items', async ({ page }) => {
await page.getByTestId('input').fill(`1
2
2
4
4
3
5`);
await page.getByTestId('removeDuplicates').check();
await page.getByTestId('itemPrefix').locator('input').fill("'");
await page.getByTestId('itemSuffix').locator('input').fill("'");
const result = await page.getByTestId('area-content').innerText();
expect(result.trim()).toEqual("'1', '2', '4', '3', '5'");
});
});