Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Feb 10, 2021
1 parent e80a720 commit bde597e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 180 deletions.
6 changes: 2 additions & 4 deletions src/__tests__/SubNavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ describe('SubNav.Link', () => {
})

it('adds activeClassName={SELECTED_CLASS} when it gets a "to" prop', () => {
const Mock = jest.fn(() => <div />)
render(<SubNav.Link as={Mock} to="#" />)
expect(Mock.mock.calls[0][0].to).toEqual('#')
expect(Mock.mock.calls[0][0].activeClassName).toEqual('selected')
const Link = ({theme, ...props}: any) => <div {...props} />
expect(render(<SubNav.Link as={Link} to="#" />)).toMatchSnapshot()
})
})
44 changes: 0 additions & 44 deletions src/__tests__/__snapshots__/SubNav.js.snap

This file was deleted.

132 changes: 0 additions & 132 deletions src/__tests__/__snapshots__/SubNavLink.js.snap

This file was deleted.

67 changes: 67 additions & 0 deletions src/__tests__/__snapshots__/SubNavLink.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SubNav.Link adds activeClassName={SELECTED_CLASS} when it gets a "to" prop 1`] = `
.c0 {
padding-left: 16px;
padding-right: 16px;
font-weight: 500;
font-size: 14px;
line-height: 20px;
min-height: 34px;
color: #24292e;
text-align: center;
-webkit-text-decoration: none;
text-decoration: none;
border-top: 1px solid #e1e4e8;
border-bottom: 1px solid #e1e4e8;
border-right: 1px solid #e1e4e8;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c0:first-of-type {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
border-left: 1px solid #e1e4e8;
}
.c0:last-of-type {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.c0:hover,
.c0:focus {
-webkit-text-decoration: none;
text-decoration: none;
background-color: #f6f8fa;
-webkit-transition: 0.2s ease;
transition: 0.2s ease;
}
.c0:hover .SubNav-octicon,
.c0:focus .SubNav-octicon {
color: #6a737d;
}
.c0.selected {
color: #fff;
background-color: #0366d6;
border: 0;
}
.c0.selected .SubNav-octicon {
color: #6a737d;
}
<div
activeClassName="selected"
className="c0 SubNav-item"
to="#"
/>
`;

exports[`SubNav.Link renders consistently 1`] = `
.c0 {
padding-left: 16px;
Expand Down

0 comments on commit bde597e

Please sign in to comment.