Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 5f89765

Browse files
test(helpers): update tests
1 parent 40d8af1 commit 5f89765

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

__tests__/helpers.spec.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,18 @@ describe('getQueryString', () => {
6666
})
6767

6868
describe('isRouteIgnored', () => {
69-
it ('should return true if home route is added to ignoreRoutes list', () => {
69+
it ('should be truthy if home route name is added to ignoreRoutes list', () => {
7070
mockUpdate({ id: 'UA-1234-5', ignoreRoutes: ['home'] })
71-
expect(helpers.isRouteIgnored('home')).toBe(true)
71+
expect(helpers.isRouteIgnored({ name: 'home' })).toBeTruthy()
72+
})
73+
74+
it ('should be truthy if home route path is added to ignoreRoutes list', () => {
75+
mockUpdate({ id: 'UA-1234-5', ignoreRoutes: ['/'] })
76+
expect(helpers.isRouteIgnored({ path: '/' })).toBeTruthy()
77+
})
78+
79+
it ('should be falsy if a `null` value is added to ignoreRoutes list', () => {
80+
mockUpdate({ id: 'UA-1234-5', ignoreRoutes: [null] })
81+
expect(helpers.isRouteIgnored({ path: '/' })).toBeFalsy()
7282
})
7383
})

0 commit comments

Comments
 (0)