]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/stateful-tab.directive.spec.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / directives / stateful-tab.directive.spec.ts
index 5cebefbc98a76f7fd4eaae5556afaeda3e06afed..295bb008c36174df82e3a6ae3723c6c9a35ec98d 100644 (file)
@@ -25,4 +25,14 @@ describe('StatefulTabDirective', () => {
     directive.onNavChange(event);
     expect(window.localStorage.getItem('tabset_bar')).toBe('xyz');
   });
+
+  it('should select the default tab if provided', () => {
+    const nav = new NgbNav('tablist', new NgbNavConfig(new NgbConfig()), <any>null, null);
+    spyOn(nav, 'select');
+    const directive = new StatefulTabDirective(nav);
+    directive.cdStatefulTab = 'bar';
+    directive.cdStatefulTabDefault = 'defaultTab';
+    directive.ngOnInit();
+    expect(nav.select).toHaveBeenCalledWith('defaultTab');
+  });
 });