Skip to content

Commit

Permalink
Add missing getter test to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Apr 21, 2024
1 parent e6e7447 commit 6852c39
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib/Actions.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, it, expect } from 'vitest';
import { CallbackAction, UrlAction } from '$lib/Actions';
import { testOptions } from '$lib/TestOptions';
import TrashCan from 'carbon-icons-svelte/lib/TrashCan.svelte';

describe(
'URL actions',
Expand Down Expand Up @@ -35,6 +36,20 @@ describe(

expect(action.url(item, 'customId')).toBe('/test/val1?id=custom_identifier');
});

it('can contain main options', () => {
const icon = TrashCan;
const action = new UrlAction('Some label', '/', icon, {
htmlAttributes: { class: 'some-class' },
buttonKind: 'some-kind'
});

expect(action.icon).toBe(icon);
expect(action.options).toStrictEqual({
htmlAttributes: { class: 'some-class' },
buttonKind: 'some-kind'
});
});
},
testOptions
);
Expand Down

0 comments on commit 6852c39

Please sign in to comment.