-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from haiafara/depfu/update/yarn/jest-27.0.5
Upgrade jest: 26.6.3 → 27.0.5 (major)
- Loading branch information
Showing
8 changed files
with
764 additions
and
1,006 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { mount } from '@vue/test-utils' | ||
import LightBox from '@/LightBox' | ||
|
||
import { mediaWithOneVideoWithAutoplay } from '../props' | ||
|
||
describe('LightBox', () => { | ||
describe('given one video with autoplay in the media array', () => { | ||
let wrapper | ||
|
||
const pauseStub = jest | ||
.spyOn(window.HTMLMediaElement.prototype, 'pause') | ||
.mockImplementation(() => {}) | ||
const playStub = jest | ||
.spyOn(window.HTMLMediaElement.prototype, 'play') | ||
.mockImplementation(() => {}) | ||
|
||
beforeEach(() => { | ||
wrapper = mount(LightBox, { | ||
propsData: { | ||
media: mediaWithOneVideoWithAutoplay | ||
} | ||
}) | ||
}) | ||
|
||
afterEach(() => { | ||
wrapper.destroy() | ||
}) | ||
|
||
describe('showImage', () => { | ||
test('calls play on the video', () => { | ||
expect(playStub).toHaveBeenCalled() | ||
}) | ||
}) | ||
|
||
describe('closeLightBox', () => { | ||
test('calls pause on the video', async () => { | ||
wrapper.vm.closeLightBox() | ||
expect(pauseStub).toHaveBeenCalledTimes(1) | ||
}) | ||
}) | ||
}) | ||
}) |
6 changes: 3 additions & 3 deletions
6
specs/LightBox/MediaArrayOneVideo.spec.js → ...MediaArrayOneVideoWithoutAutoplay.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.