mirror of
https://github.com/Art051/it-tools.git
synced 2025-08-11 19:29:03 +00:00
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:
committed by
Corentin Thomasset
parent
ce3150c65d
commit
83a7b3bae9
39
src/tools/list-converter/list-converter.e2e.spec.ts
Normal file
39
src/tools/list-converter/list-converter.e2e.spec.ts
Normal 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'");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user