Skip to content

Instantly share code, notes, and snippets.

@dagda1

dagda1/test.ts

Last active Jun 2, 2020
Embed
What would you like to do?
test.each`
url | path | expected | message
${'/csg/product-selector'} | ${RoleDetailsUrl} | ${makeCsgUrl(RoleDetailsUrl)} | ${'should be csg url'}
${'/applicant/join/product-selector'} | ${ProductSelector} | ${makeApplicantJoinUrl(ProductSelector)} | ${'should be applicant url'}
${'/applicant/existing/current-name'} | ${CurrentName} | ${makeApplicantExistingUrl(CurrentName)} | ${'should be applicant url'}
${'/personal-employer/join/details'} | ${PERoleDetailsUrl} | ${makePersonalEmployerJoinUrl(PERoleDetailsUrl)} | ${'should be personal employer url'}
`('url:$url is is $expected, // $message ', ({ url, expected }) => {
history.push(url);
const {
result: { current },
} = renderHook(() => useGetApplicationTypeFromUrl(), {
wrapper: ({ children }) => <Provider store={store}>{children}</Provider>,
});
expect(current).toBe(expected);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.