+ name: "Type 1",
+ createSchema: typedSchemaObject,
+ };
+ TestBed.overrideProvider(MAT_DIALOG_DATA, { useValue: policyData }); // Should be provided with a policy
+ ({ fixture, component, loader } = compileAndGetComponents(
+ fixture,
+ component,
+ loader
+ ));
+ });
+
+ it("should contain oran logo and create title and no instance info", async () => {
+ let ele = fixture.debugElement.nativeElement.querySelector("img");
+ expect(ele.src).toContain("assets/oran-logo.png");
+
+ ele = fixture.debugElement.nativeElement.querySelector("text");
+ expect(ele.textContent).toEqual(
+ "Create new policy instance of type Type 1"
+ );
+
+ ele = fixture.debugElement.nativeElement.querySelector("#instanceInfo");
+ expect(ele).toBeFalsy();
+ });
+
+ it("should contain ric select", async () => {
+ const ele = fixture.debugElement.nativeElement.querySelector(
+ "nrcp-ric-selector"
+ );
+ expect(ele).toBeTruthy();
+ });
+
+ it("should contain typed json editor", async () => {
+ const ele = fixture.debugElement.nativeElement.querySelector(
+ "nrcp-typed-policy-editor"
+ );
+ expect(ele).toBeTruthy();
+ });
+
+ it("should contain enabled Close button and disabled Submit button", async () => {
+ component.ngOnInit();
+
+ let closeButton: MatButtonHarness = await loader.getHarness(
+ MatButtonHarness.with({ selector: "#closeButton" })
+ );
+ expect(await closeButton.isDisabled()).toBeFalsy();
+ expect(await closeButton.getText()).toEqual("Close");
+
+ let submitButton: MatButtonHarness = await loader.getHarness(
+ MatButtonHarness.with({ selector: "#submitButton" })
+ );
+ // expect(await submitButton.isDisabled()).toBeTruthy();
+ expect(await submitButton.getText()).toEqual("Submit");
+ });
+ });
+
+ describe("content when editing policy without type", () => {
+ beforeEach(async () => {
+ const policyData = {
+ createSchema: untypedSchemaObject,
+ instanceId: "instanceId",