Skip to content

Commit

Permalink
test: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
unix committed Jun 22, 2020
1 parent 36f6580 commit df7973c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 118 deletions.
15 changes: 11 additions & 4 deletions components/modal/__tests__/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`Modal customization should be supported 1`] = `
text-align: center;
margin: 0;
display: inline-flex;
flex-shrink: 0;
justify-content: center;
align-items: center;
word-break: break-word;
Expand All @@ -18,6 +19,7 @@ exports[`Modal customization should be supported 1`] = `
</style><style>
.wrapper {
max-width: 85vw;
max-height: 75vh;
width: 100px;
overflow: hidden;
display: flex;
Expand Down Expand Up @@ -66,6 +68,7 @@ exports[`Modal should render correctly 1`] = `
text-align: center;
margin: 0;
display: inline-flex;
flex-shrink: 0;
justify-content: center;
align-items: center;
word-break: break-word;
Expand All @@ -88,8 +91,9 @@ exports[`Modal should render correctly 1`] = `
}
</style><div class=\\"content \\"><p>Some content contained within the modal.</p></div><style>
.content {
margin: 0;
padding: 16pt 0 8pt 0;
margin: 0 -16pt;
padding: 16pt 16pt 8pt;
overflow-y: auto;
}
.content > :global(*:first-child) {
Expand Down Expand Up @@ -166,10 +170,12 @@ exports[`Modal should render correctly 1`] = `
div {
height: 3.625rem;
flex-shrink: 0;
}
</style><style>
.wrapper {
max-width: 85vw;
max-height: 75vh;
width: 26rem;
overflow: hidden;
display: flex;
Expand Down Expand Up @@ -215,7 +221,7 @@ exports[`Modal should render correctly 1`] = `
align-content: center;
align-items: center;
flex-direction: column;
justify-content: center;
justify-content: space-around;
height: 100vh;
width: 100vw;
overflow: auto;
Expand All @@ -232,8 +238,9 @@ exports[`Modal should render correctly 1`] = `
}
.offset {
height: 25vh;
height: 0;
opacity: 0;
display: flex;
background-color: transparent;
}
Expand Down
103 changes: 3 additions & 100 deletions components/shared/__tests__/__snapshots__/backdrop.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,103 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Backdrop content should be offset 1`] = `
"<div class=\\"backdrop transition-enter\\"><div class=\\"layer\\"></div><div class=\\"content\\"><span>test-value</span></div><div class=\\"offset\\"></div><style>
.backdrop {
position: fixed;
top: 0;
left: 0;
display: flex;
align-content: center;
align-items: center;
flex-direction: column;
justify-content: center;
height: 100vh;
width: 100vw;
overflow: auto;
z-index: 1000;
}
.content {
display: flex;
align-items: center;
justify-content: center;
position: relative;
z-index: 1001;
outline: none;
}
.offset {
height: 0vh;
opacity: 0;
background-color: transparent;
}
.layer {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
opacity: 0.25;
background-color: black;
transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
pointer-events: none;
z-index: 1000;
}
</style></div>"
`;
exports[`Backdrop content should be offset 2`] = `
"<div class=\\"backdrop transition-enter\\"><div class=\\"layer\\"></div><div class=\\"content\\"><span>test-value</span></div><div class=\\"offset\\"></div><style>
.backdrop {
position: fixed;
top: 0;
left: 0;
display: flex;
align-content: center;
align-items: center;
flex-direction: column;
justify-content: center;
height: 100vh;
width: 100vw;
overflow: auto;
z-index: 1000;
}
.content {
display: flex;
align-items: center;
justify-content: center;
position: relative;
z-index: 1001;
outline: none;
}
.offset {
height: 100vh;
opacity: 0;
background-color: transparent;
}
.layer {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
opacity: 0.25;
background-color: black;
transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
pointer-events: none;
z-index: 1000;
}
</style></div>"
`;
exports[`Backdrop should render correctly 1`] = `
"<div class=\\"backdrop transition-enter\\"><div class=\\"layer\\"></div><div class=\\"content\\"><span>test-value</span></div><div class=\\"offset\\"></div><style>
.backdrop {
Expand All @@ -108,7 +10,7 @@ exports[`Backdrop should render correctly 1`] = `
align-content: center;
align-items: center;
flex-direction: column;
justify-content: center;
justify-content: space-around;
height: 100vh;
width: 100vw;
overflow: auto;
Expand All @@ -125,8 +27,9 @@ exports[`Backdrop should render correctly 1`] = `
}
.offset {
height: 0vh;
height: 0;
opacity: 0;
display: flex;
background-color: transparent;
}
Expand Down
14 changes: 0 additions & 14 deletions components/shared/__tests__/backdrop.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,6 @@ describe('Backdrop', () => {
handler.mockRestore()
})

it('content should be offset', () => {
const wrapper = mount(
<Backdrop visible>
<span>test-value</span>
</Backdrop>,
)
const notOffset = wrapper.html()
expect(wrapper.html()).toMatchSnapshot()

wrapper.setProps({ offsetY: '100' })
expect(wrapper.html()).toMatchSnapshot()
expect(notOffset).not.toEqual(wrapper.html())
})

it('backdrop handler should ignore click events from content', async () => {
const handler = jest.fn()
const wrapper = mount(
Expand Down

0 comments on commit df7973c

Please sign in to comment.