summaryrefslogtreecommitdiffstats
path: root/src/app/shared/directives/collapse.component.spec.ts
blob: 0d234d751e2a3d994b64860a6bd3d07ea1fcabb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Collapse } from './collapse.component';
import { ElementRef } from '@angular/core';


describe('CollapseComponent', () => {
    let directive;

    beforeEach(() => {
        directive = new Collapse();
    });

    it('should create an instance', () => {
        expect(directive).toBeTruthy();
    });

    describe('should toggle', () => {
        it('should call hide() if isExpanded is true', () => {
            directive.isExpanded = true;

            directive.toggle();
        });

        it('should call show() if isExpanded is false', () => {
            directive.isExpanded = false;

            directive.toggle();
        });


    });
});