Skip to content

Commit

Permalink
fix: Downgrade Jest to 24.9.0 to enable coverage collection. Close #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Levshin committed Feb 14, 2020
1 parent 6e4fa28 commit 51c91aa
Show file tree
Hide file tree
Showing 6 changed files with 1,790 additions and 3,538 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -60,7 +60,7 @@ npm test
</div>
<div id="loader">
Loader
Loader...
</div>
</MetamaskChecker>
</template>
Expand Down
25 changes: 24 additions & 1 deletion __tests__/MetamaskChecker.test.js
Expand Up @@ -28,7 +28,28 @@ describe('MetamaskChecker', () => {

const checkedText = `Selected account ${ACCOUNT} in selected network ${NETWORK}`

it('renders "default" slot when nothing happens', async () => {
it('throws an error when default slot not specified', async () => {
expect(() => mount(MetamaskChecker)).toThrowError('Cannot determine slot for rendering!')

expect(() => mount(MetamaskChecker, {
scopedSlots: {
errored: erroredSlot,
},
})).toThrowError('Cannot determine slot for rendering!')
expect(() => mount(MetamaskChecker, {
scopedSlots: {
checked: checkedSlot,
},
})).toThrowError('Cannot determine slot for rendering!')
expect(() => mount(MetamaskChecker, {
scopedSlots: {
errored: erroredSlot,
checked: checkedSlot,
},
})).toThrowError('Cannot determine slot for rendering!')
})

it('renders "default" slot when nothing happens and destroys normally', async () => {
const wrapper = mount(MetamaskChecker, {
scopedSlots: {
errored: erroredSlot,
Expand All @@ -40,6 +61,8 @@ describe('MetamaskChecker', () => {
})

expect(wrapper.contains('[id="loader"]')).toBe(true)

wrapper.destroy()
})

it('renders "errored" slot when something wrong with MetamaskInpageProvider', async () => {
Expand Down

0 comments on commit 51c91aa

Please sign in to comment.