mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-29 02:49:13 -04:00
feat(new tool): ULID generator (#623)
This commit is contained in:
parent
557b30426f
commit
5c4d775e2d
11 changed files with 174 additions and 1 deletions
23
src/tools/ulid-generator/ulid-generator.e2e.spec.ts
Normal file
23
src/tools/ulid-generator/ulid-generator.e2e.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { expect, test } from '@playwright/test';
|
||||
|
||||
const ULID_REGEX = /[0-9A-Z]{26}/;
|
||||
|
||||
test.describe('Tool - ULID generator', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/ulid-generator');
|
||||
});
|
||||
|
||||
test('Has correct title', async ({ page }) => {
|
||||
await expect(page).toHaveTitle('ULID generator - IT Tools');
|
||||
});
|
||||
|
||||
test('the refresh button generates a new ulid', async ({ page }) => {
|
||||
const ulid = await page.getByTestId('ulids').textContent();
|
||||
expect(ulid?.trim()).toMatch(ULID_REGEX);
|
||||
|
||||
await page.getByTestId('refresh').click();
|
||||
const newUlid = await page.getByTestId('ulids').textContent();
|
||||
expect(ulid?.trim()).not.toBe(newUlid?.trim());
|
||||
expect(newUlid?.trim()).toMatch(ULID_REGEX);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue