aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/utils/iframe.service.spec.ts
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2020-01-01 10:39:51 +0000
committerGerrit Code Review <gerrit@onap.org>2020-01-01 10:39:51 +0000
commit5a3532bc41b580fea966f4be79d0b5462ef7434d (patch)
treeb67bdb1f72aba6f9aa9929600089aa5586be1032 /vid-webpack-master/src/app/shared/utils/iframe.service.spec.ts
parent42e59f3f3af996a2de92186203d67231c994fa9e (diff)
parent51d9784740b2fa457fe39046de222930d07da0c1 (diff)
Merge "Show Templates popup when deploying from "SDC Catalog""
Diffstat (limited to 'vid-webpack-master/src/app/shared/utils/iframe.service.spec.ts')
-rw-r--r--vid-webpack-master/src/app/shared/utils/iframe.service.spec.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/utils/iframe.service.spec.ts b/vid-webpack-master/src/app/shared/utils/iframe.service.spec.ts
new file mode 100644
index 000000000..fd5fe0e65
--- /dev/null
+++ b/vid-webpack-master/src/app/shared/utils/iframe.service.spec.ts
@@ -0,0 +1,40 @@
+import {getTestBed, TestBed} from "@angular/core/testing";
+import {IframeService} from "./iframe.service";
+import {DialogService} from "ng2-bootstrap-modal";
+
+export class DialogServiceMock extends DialogService {
+ removeDialog: (that) => ({})
+}
+
+describe('Iframe service', () => {
+ let injector;
+ let service: IframeService;
+ beforeAll(done => (async () => {
+ TestBed.configureTestingModule({
+ providers : [
+ IframeService
+ ]
+ });
+ await TestBed.compileComponents();
+
+ injector = getTestBed();
+ service = injector.get(IframeService);
+
+ })().then(done).catch(done.fail));
+
+
+ test('service should be defined', ()=>{
+ expect(service).toBeDefined();
+ });
+
+ test('closeIframe: should call removeClassCloseModal', ()=>{
+ const dialogService = new DialogServiceMock(null, null, null, null);
+ spyOn(service, 'removeClassCloseModal');
+ spyOn(dialogService, 'removeDialog');
+ service.closeIframe(dialogService, {})
+
+ expect(service.removeClassCloseModal).toBeCalledWith('content');
+ expect(dialogService.removeDialog).toBeCalledWith({});
+ });
+
+});