mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Use spies instead of monkey patching
This commit is contained in:
committed by
Antonio Scandurra
parent
47761a455e
commit
f2e2475c62
@@ -885,10 +885,8 @@ describe('TextEditorComponent', () => {
|
||||
fakeWindow.appendChild(element)
|
||||
jasmine.attachToDOM(fakeWindow)
|
||||
|
||||
component.getWindowInnerWidth = () => fakeWindow.getBoundingClientRect().width
|
||||
component.getWindowInnerHeight = () => fakeWindow.getBoundingClientRect().height
|
||||
// spyOn(component, 'getWindowInnerWidth').andCallFake(() => fakeWindow.getBoundingClientRect().width)
|
||||
// spyOn(component, 'getWindowInnerHeight').andCallFake(() => fakeWindow.getBoundingClientRect().height)
|
||||
spyOn(component, 'getWindowInnerWidth').andCallFake(() => fakeWindow.getBoundingClientRect().width)
|
||||
spyOn(component, 'getWindowInnerHeight').andCallFake(() => fakeWindow.getBoundingClientRect().height)
|
||||
await setScrollTop(component, 50)
|
||||
await setScrollLeft(component, 100)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user