mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-11 03:16:48 +03:00
Fix tests
This commit is contained in:
parent
c45df1e445
commit
0712297ba5
|
@ -55,7 +55,7 @@ export default class StickySidebar {
|
|||
}
|
||||
|
||||
get scrollY() {
|
||||
return (this.scrollParent.pageYOffset === null) ? this.scrollParent.scrollTop : this.scrollParent.pageYOffset;
|
||||
return (this.scrollParent.pageYOffset !== null) ? this.scrollParent.pageYOffset : this.scrollParent.scrollTop;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -49,7 +49,9 @@ describe('Common components', () => {
|
|||
it('should stick if scrolled more than scrollYOffset', () => {
|
||||
spyOn(component, 'stick').and.callThrough();
|
||||
fixture.detectChanges();
|
||||
window.pageYOffset = 40;
|
||||
component.scrollParent = {
|
||||
pageYOffset: 40
|
||||
};
|
||||
component.updatePosition();
|
||||
expect(component.stick).toHaveBeenCalled();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user