aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/shared/directives/collapse.component.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/shared/directives/collapse.component.spec.ts')
-rw-r--r--src/app/shared/directives/collapse.component.spec.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/app/shared/directives/collapse.component.spec.ts b/src/app/shared/directives/collapse.component.spec.ts
new file mode 100644
index 0000000..0d234d7
--- /dev/null
+++ b/src/app/shared/directives/collapse.component.spec.ts
@@ -0,0 +1,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();
+ });
+
+
+ });
+}); \ No newline at end of file