mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
Add + fix tests
This commit is contained in:
parent
a8d98b127b
commit
4066362ab9
|
@ -21,7 +21,7 @@
|
|||
title="{{schema._displayTypeHint}}">{{schema._displayType}} {{schema._displayFormat}}
|
||||
<span class="param-range" *ngIf="schema._range"> {{schema._range}} </span>
|
||||
</span>
|
||||
<span *ngIf="prop['x-nullable']" class="param-nullable">Nullable</span>
|
||||
<span *ngIf="schema['x-nullable']" class="param-nullable">Nullable</span>
|
||||
<div *ngIf="schema.enum" class="param-enum">
|
||||
<span *ngFor="let enumItem of schema.enum" class="enum-value {{enumItem.type}}"> {{enumItem.val | json}} </span>
|
||||
</div>
|
||||
|
|
|
@ -27,10 +27,23 @@ describe('Common components', () => {
|
|||
expect(component).not.toBeNull();
|
||||
});
|
||||
|
||||
it('should start sticked', () => {
|
||||
it('should start unsticked', () => {
|
||||
spyOn(component, 'stick').and.callThrough();
|
||||
spyOn(component, 'stickBottom').and.callThrough();
|
||||
fixture.detectChanges();
|
||||
expect(component.stick).toHaveBeenCalled();
|
||||
expect(component.stick).not.toHaveBeenCalled();
|
||||
expect(component.stickBottom).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should stick to the top on the next VM tick', (done) => {
|
||||
spyOn(component, 'stick').and.callThrough();
|
||||
spyOn(component, 'stickBottom').and.callThrough();
|
||||
fixture.detectChanges();
|
||||
setTimeout(() => {
|
||||
expect(component.stick).toHaveBeenCalled();
|
||||
expect(component.stickBottom).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should stick if scrolled more than scrollYOffset', () => {
|
||||
|
@ -42,6 +55,8 @@ describe('Common components', () => {
|
|||
component.updatePosition();
|
||||
expect(component.stick).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
// TODO: add tests for stickBottom
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user