Skip to content

Commit

Permalink
test(rating): add missing coverage block (#3409)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterblazejewicz authored and maxokorokov committed Oct 17, 2019
1 parent ad2800d commit 2cf28f4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rating/rating.spec.ts
Expand Up @@ -484,6 +484,14 @@ describe('ngb-rating', () => {
fixture.detectChanges();
expect(getState(element.nativeElement)).toEqual([true, true, true, false, false]);
expect(event.preventDefault).toHaveBeenCalled();

// any other -> 0
event = createKeyDownEvent(Key.Space);
const expectedState = getState(element.nativeElement);
element.triggerEventHandler('keydown', event);
fixture.detectChanges();
expect(getState(element.nativeElement)).toEqual(expectedState);
expect(event.preventDefault).not.toHaveBeenCalled();
});

it('should handle home/end keys', () => {
Expand Down

0 comments on commit 2cf28f4

Please sign in to comment.