Add failing test for hasQuickActions

This commit is contained in:
Winnie Hellmann 2019-05-06 22:04:59 +02:00
parent bc75355986
commit 4ce36f3443
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import { hasQuickActions } from '~/notes/stores/utils';
describe('hasQuickActions', () => {
it.each`
input | expected
${'some comment'} | ${false}
${'/quickaction'} | ${true}
${'some comment with\n/quickaction'} | ${true}
`('returns $expected for $input', ({ input, expected }) => {
expect(hasQuickActions(input)).toBe(expected);
});
it('is stateless', () => {
expect(hasQuickActions('some comment')).toBe(hasQuickActions('some comment'));
expect(hasQuickActions('/quickaction')).toBe(hasQuickActions('/quickaction'));
});
});