Skip to content

refactor(schematics): add test case for overlay property name change #13140

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions src/lib/schematics/update/material/data/property-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ export const propertyNames: VersionChanges<MaterialPropertyNameData> = {
}
}
]
},

{
pr: 'https://github.com/angular/material2/pull/12927',
changes: [
{
replace: 'flexibleDiemsions',
replaceWith: 'flexibleDimensions',
whitelist: {
classes: ['CdkConnectedOverlay']
}
}
]
}
],

Expand Down Expand Up @@ -353,19 +366,5 @@ export const propertyNames: VersionChanges<MaterialPropertyNameData> = {
}
]
},

// TODO(devversion): this should be part of the V6 to V7 upgrade
{
pr: 'https://github.com/angular/material2/pull/12927',
changes: [
{
replace: 'flexibleDiemsions',
replaceWith: 'flexibleDimensions',
whitelist: {
classes: ['CdkConnectedOverlay']
}
}
]
}
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ class SelectionModel {
onChange = new EventEmitter<void>();
}

class CdkConnectedOverlay {
flexibleDiemsions: boolean;
}

/* Actual test case using the previously defined definitions. */

class A implements OnInit {
self = {me: this};

constructor(private a: SelectionModel) {}
constructor(private a: SelectionModel, private b: CdkConnectedOverlay) {}

ngOnInit() {
this.a.changed.subscribe(() => console.log('Changed'));
this.self.me.a.changed.subscribe(() => console.log('Changed 2'));

if (this.b.flexibleDimensions) {
console.log(this.b.flexibleDimensions ? 'true' : 'false');
}

const _state = this.self.me.b.flexibleDimensions.toString() || 'not-defined';
}
}
12 changes: 11 additions & 1 deletion src/lib/schematics/update/test-cases/v7/property-names_input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ class SelectionModel {
onChange = new EventEmitter<void>();
}

class CdkConnectedOverlay {
flexibleDiemsions: boolean;
}

/* Actual test case using the previously defined definitions. */

class A implements OnInit {
self = {me: this};

constructor(private a: SelectionModel) {}
constructor(private a: SelectionModel, private b: CdkConnectedOverlay) {}

ngOnInit() {
this.a.onChange.subscribe(() => console.log('Changed'));
this.self.me.a.onChange.subscribe(() => console.log('Changed 2'));

if (this.b.flexibleDiemsions) {
console.log(this.b.flexibleDiemsions ? 'true' : 'false');
}

const _state = this.self.me.b.flexibleDiemsions.toString() || 'not-defined';
}
}