diff options
Diffstat (limited to 'spec/frontend/repository/components/table/row_spec.js')
-rw-r--r-- | spec/frontend/repository/components/table/row_spec.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/frontend/repository/components/table/row_spec.js b/spec/frontend/repository/components/table/row_spec.js index 22570b2d6ed..13b09e57473 100644 --- a/spec/frontend/repository/components/table/row_spec.js +++ b/spec/frontend/repository/components/table/row_spec.js @@ -31,7 +31,7 @@ function factory(propsData = {}) { GlHoverLoad: createMockDirective(), }, provide: { - glFeatures: { refactorBlobViewer: true, lazyLoadCommits: true }, + glFeatures: { lazyLoadCommits: true }, }, mocks: { $router, @@ -244,8 +244,6 @@ describe('Repository table row component', () => { }); describe('row visibility', () => { - beforeAll(() => jest.useFakeTimers()); - beforeEach(() => { factory({ id: '1', @@ -260,12 +258,13 @@ describe('Repository table row component', () => { afterAll(() => jest.useRealTimers()); it('emits a `row-appear` event', async () => { + const setTimeoutSpy = jest.spyOn(global, 'setTimeout'); findIntersectionObserver().vm.$emit('appear'); jest.runAllTimers(); - expect(setTimeout).toHaveBeenCalledTimes(1); - expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), ROW_APPEAR_DELAY); + expect(setTimeoutSpy).toHaveBeenCalledTimes(1); + expect(setTimeoutSpy).toHaveBeenLastCalledWith(expect.any(Function), ROW_APPEAR_DELAY); expect(vm.emitted('row-appear')).toEqual([[123]]); }); }); |