Skip to content

Commit 0ee6fc2

Browse files
committed
add a test for the pure generateSlug function
1 parent 65c3c22 commit 0ee6fc2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/heading-linkable/index.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ describe('heading-linkable', () => {
9797
])
9898
)
9999
})
100+
101+
test('generateSlug function works correctly', () => {
102+
const generateSlug = headingLinkable.generateSlug
103+
expect(generateSlug('foo bar')).toEqual('foo-bar')
104+
expect(generateSlug('foo bar', ['foo-bar'])).toEqual('foo-bar-1')
105+
})
100106
})
101107

102108
// Takes an array of expected results, [literal text, slug, aria label]

0 commit comments

Comments
 (0)