Skip to content

Commit

Permalink
test(ui): minimize warning in ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
timonback committed Oct 11, 2024
1 parent 7c109dd commit 0d09d54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions springwolf-ui/src/app/components/mock-components.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: Apache-2.0 */
import { Component, input } from "@angular/core";
import { Component, input, model } from "@angular/core";
import { Schema } from "../models/schema.model";
import { Operation } from "../models/operation.model";

Expand Down Expand Up @@ -36,8 +36,11 @@ export class MockChannelOperationComponent {

@Component({ selector: "app-prism-editor", template: "" })
export class MockPrismEditorComponent {
code = input<string>("");
code = model<string>("");
language = input<string>("");
readonly = input<boolean, string>(false, {
transform: (value: string) => value == "true",
});
}

@Component({ selector: "app-schema-new", template: "" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import {
mockedExampleSchemaMapped,
} from "../../../service/mock/mock-asyncapi.service";
import { MaterialModule } from "../../../material.module";
import { MockChannelOperationComponent } from "../../mock-components.spec";
import {
MockChannelOperationComponent,
MockPrismEditorComponent,
} from "../../mock-components.spec";

describe("ChannelsNewComponent", () => {
beforeEach(async () => {
mockedAsyncApiService.getAsyncApi.mockClear();

await render(ChannelsNewComponent, {
imports: [MaterialModule],
declarations: [MockChannelOperationComponent],
declarations: [MockChannelOperationComponent, MockPrismEditorComponent],
providers: [
{ provide: AsyncApiService, useValue: mockedAsyncApiService },
],
Expand Down

0 comments on commit 0d09d54

Please sign in to comment.