Skip to content

feature[TW26940]: Web - Refactor @Input to signal inputs and playwrig… #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

huyatran4
Copy link
Contributor

…ht tests

@@ -656,7 +661,10 @@
"environment": "all"
},
"packageManager": "pnpm",
"schematicCollections": ["@angular-eslint/schematics"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need to fix your editor setup to use prettier and eslint to fix this automatically

await page.goto('http://localhost:4200/ple/artifact/explorer');

//Choose a working branch, view the artifact
await page.getByRole('radio', { name: 'Working' }).check();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need an expect in here somewhere?

@@ -0,0 +1,84 @@
import { test, expect } from '@ngx-playwright/test';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming nit - create-action-commit-branch instead of createaction-commitbranch

//Go to Artifact Explorer page
await page.goto('http://localhost:4200/ple/artifact/explorer');

// Search & Pick product line branch then look for its change report
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these should probably have an expect at some point to check that performing the action actually "did" what it says

}
branchType = input<'working' | 'baseline' | undefined>();
branchId = input.required<string>()
constructor() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an effect is not needed for this....go look at MIM

private headerService = inject(HeaderService);
private crService = inject(ChangeReportService);

@Input() branchId = '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simpler, better fix: branchId = input.required();
branchId$ = toObservable(this.branchId);

relationSide = input.required<artifactRelationSide>();
typeToken = input.required<relationTypeToken>();
paths = input.required<string[][]>();
constructor() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these _ observables can just be derived via toObservable()

@@ -13,19 +13,21 @@
@if (branchId$ | async; as branchId) {
@if (option$ | async; as options) {
@if (options.showRelations) {
@if (relation$ | async; as relations) {
@if (relation$() | async; as relations) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? if it's a signal, it shouldn't be async. So either use the observable with |async or use the signal with ()

@@ -30,9 +30,19 @@ export class ArtifactHierarchyRelationsComponent {
private optionsService = inject(ArtifactHierarchyOptionsService);
private uiService = inject(UiService);

@Input() relation$!: Observable<artifactRelation[]>;
@Input() paths!: string[][];
relation$ = input.required<Observable<artifactRelation[]>>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above, use toObservable()

@@ -68,8 +68,14 @@ export class ArtifactHierarchyComponent {
);

artifactId = input.required<string>();
@Input() set paths(paths: string[][]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use toObservable()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants