Skip to content

Commit

Permalink
fix: add schematics example to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oknimot committed Nov 23, 2022
1 parent 2aabd22 commit a06e30e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions projects/cdk/schematics/ng-update/steps/migrate-input-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function replaceLabelLinkInputs(
templateResource,
fileSystem,
componentSelector: 'tui-input-files',
from: 'label',
from: '[label]',
to: '[content]',
newValue: LABEL_LINK_INPUTS_MIGRATION_METHOD_NAME,
});
Expand All @@ -79,18 +79,18 @@ function replaceLabelLinkInputs(
templateResource,
fileSystem,
componentSelector: 'tui-input-files',
from: 'link',
from: '[link]',
to: '[content]',
newValue: LABEL_LINK_INPUTS_MIGRATION_METHOD_NAME,
filterFn: element => !hasElementAttribute(element, 'label'),
filterFn: element => !hasElementAttribute(element, '[label]'),
});

removeInputProperty({
templateResource,
fileSystem,
componentSelector: 'tui-input-files',
inputProperty: 'link',
filterFn: element => hasElementAttribute(element, 'label'),
inputProperty: '[link]',
filterFn: element => hasElementAttribute(element, '[label]'),
});

if (wasLabelInputModified || wasLinkInputModified) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ const TEMPLATE_BEFORE = `
</a>
</ng-container>
</tui-breadcrumbs>
<tui-input-files
[label]="contentLabel"
[link]="contentLink"
>
</tui-input-files>
`;

const TEMPLATE_AFTER = `<!-- TODO: (Taiga UI migration) tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number -->
Expand Down Expand Up @@ -359,6 +365,11 @@ const TEMPLATE_AFTER = `<!-- TODO: (Taiga UI migration) tuiFormatNumber pipe has
</a>
</ng-container>
</tui-breadcrumbs>
<tui-input-files
[content]="contentLabel"
>
</tui-input-files>
`;

const COMPONENT_BEFORE = `
Expand Down

0 comments on commit a06e30e

Please sign in to comment.