Skip to content

Commit

Permalink
fix(test case): fixed broken test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnydanu committed Oct 27, 2024
1 parent 0c14078 commit 8eab43b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
4 changes: 4 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,14 @@ declare module '@vue/runtime-core' {
NDivider: typeof import('naive-ui')['NDivider']
NDynamicInput: typeof import('naive-ui')['NDynamicInput']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
NH1: typeof import('naive-ui')['NH1']
NH2: typeof import('naive-ui')['NH2']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NMenu: typeof import('naive-ui')['NMenu']
Expand Down
7 changes: 2 additions & 5 deletions src/tools/list-converter/list-converter.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test.describe('Tool - List converter', () => {
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 }) => {
test('Duplicates should be removed items', async ({ page }) => {
await page.getByTestId('input').fill(`1
2
2
Expand All @@ -30,10 +30,7 @@ test.describe('Tool - List converter', () => {
3
5`);
await page.getByTestId('removeDuplicates').check();
await page.getByTestId('itemPrefix').fill('\'');
await page.getByTestId('itemSuffix').fill('\'');

const result = await page.getByTestId('area-content').innerText();
expect(result.trim()).toEqual('\'1\', \'2\', \'4\', \'3\', \'5\'');
expect(result.trim()).toEqual('1, 2, 4, 3, 5');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('otp functions', () => {
describe('buildKeyUri', () => {
it('build a key uri string', () => {
expect(buildKeyUri({ secret: 'JBSWY3DPEHPK3PXP' })).to.eql(
'otpauth://totp/godev-run:demo-user?issuer=godev-run&secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&period=30',
'otpauth://totp/godev.run:demo-user?issuer=godev-run&secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&period=30',
);

expect(
Expand Down
2 changes: 1 addition & 1 deletion src/tools/otp-code-generator-and-validator/otp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function verifyTOTP({

function buildKeyUri({
secret,
app = 'GoDev.Run',
app = 'godev.run',
account = 'demo-user',
algorithm = 'SHA1',
digits = 6,
Expand Down
4 changes: 2 additions & 2 deletions src/tools/text-to-binary/text-to-binary.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ test.describe('Tool - Text to ASCII binary', () => {
await page.getByTestId('text-to-binary-input').fill('godev.run');
const binary = await page.getByTestId('text-to-binary-output').inputValue();

expect(binary).toEqual('01101001 01110100 00101101 01110100 01101111 01101111 01101100 01110011');
expect(binary).toEqual('01100111 01101111 01100100 01100101 01110110 00101110 01110010 01110101 01101110');
});

test('Binary to text conversion', async ({ page }) => {
await page.getByTestId('binary-to-text-input').fill('01101001 01110100 00101101 01110100 01101111 01101111 01101100 01110011');
await page.getByTestId('binary-to-text-input').fill('01100111 01101111 01100100 01100101 01110110 00101110 01110010 01110101 01101110');
const text = await page.getByTestId('binary-to-text-output').inputValue();

expect(text).toEqual('godev.run');
Expand Down
4 changes: 2 additions & 2 deletions src/tools/text-to-unicode/text-to-unicode.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ test.describe('Tool - Text to Unicode', () => {
await page.getByTestId('text-to-unicode-input').fill('godev.run');
const unicode = await page.getByTestId('text-to-unicode-output').inputValue();

expect(unicode).toEqual('it-tools');
expect(unicode).toEqual('godev.run');
});

test('Unicode to text conversion', async ({ page }) => {
await page.getByTestId('unicode-to-text-input').fill('it-tools');
await page.getByTestId('unicode-to-text-input').fill('godev.run');
const text = await page.getByTestId('unicode-to-text-output').inputValue();

expect(text).toEqual('godev.run');
Expand Down

0 comments on commit 8eab43b

Please sign in to comment.