Skip to content

Commit 8e2a666

Browse files
amysortommalerba
authored andcommitted
fix(material/schematics): fix icon button selector and move button migrator to its own folder
1 parent 352153f commit 8e2a666

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/material/schematics/ng-generate/mdc-migration/rules/button-styles.spec.ts renamed to src/material/schematics/ng-generate/mdc-migration/rules/components/button/button-styles.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {createTestApp, patchDevkitTreeToExposeTypeScript} from '@angular/cdk/schematics/testing';
22
import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';
3-
import {Schema} from '../schema';
3+
import {Schema} from '../../../schema';
44
import {runfiles} from '@bazel/runfiles';
55

66
describe('button styles', () => {
@@ -42,8 +42,8 @@ describe('button styles', () => {
4242
@include mat.mdc-button-typography($theme);
4343
@include mat.mdc-fab-theme($theme);
4444
@include mat.mdc-fab-typography($theme);
45-
@include mat.mdc-icon-theme($theme);
46-
@include mat.mdc-icon-typography($theme);
45+
@include mat.mdc-icon-button-theme($theme);
46+
@include mat.mdc-icon-button-typography($theme);
4747
`,
4848
);
4949
});
@@ -62,8 +62,8 @@ describe('button styles', () => {
6262
@include arbitrary.mdc-button-typography($theme);
6363
@include arbitrary.mdc-fab-theme($theme);
6464
@include arbitrary.mdc-fab-typography($theme);
65-
@include arbitrary.mdc-icon-theme($theme);
66-
@include arbitrary.mdc-icon-typography($theme);
65+
@include arbitrary.mdc-icon-button-theme($theme);
66+
@include arbitrary.mdc-icon-button-typography($theme);
6767
`,
6868
);
6969
});
@@ -85,14 +85,14 @@ describe('button styles', () => {
8585
@include mat.mdc-button-typography($light-theme);
8686
@include mat.mdc-fab-theme($light-theme);
8787
@include mat.mdc-fab-typography($light-theme);
88-
@include mat.mdc-icon-theme($light-theme);
89-
@include mat.mdc-icon-typography($light-theme);
88+
@include mat.mdc-icon-button-theme($light-theme);
89+
@include mat.mdc-icon-button-typography($light-theme);
9090
@include mat.mdc-button-theme($dark-theme);
9191
@include mat.mdc-button-typography($dark-theme);
9292
@include mat.mdc-fab-theme($dark-theme);
9393
@include mat.mdc-fab-typography($dark-theme);
94-
@include mat.mdc-icon-theme($dark-theme);
95-
@include mat.mdc-icon-typography($dark-theme);
94+
@include mat.mdc-icon-button-theme($dark-theme);
95+
@include mat.mdc-icon-button-typography($dark-theme);
9696
`,
9797
);
9898
});
@@ -117,8 +117,8 @@ describe('button styles', () => {
117117
@include mat.mdc-button-typography($theme);
118118
@include mat.mdc-fab-theme($theme);
119119
@include mat.mdc-fab-typography($theme);
120-
@include mat.mdc-icon-theme($theme);
121-
@include mat.mdc-icon-typography($theme);
120+
@include mat.mdc-icon-button-theme($theme);
121+
@include mat.mdc-icon-button-typography($theme);
122122
123123
124124
`,

src/material/schematics/ng-generate/mdc-migration/rules/button-styles.ts renamed to src/material/schematics/ng-generate/mdc-migration/rules/components/button/button-styles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ClassNameChange, StyleMigrator} from './style-migrator';
9+
import {ClassNameChange, StyleMigrator} from '../../style-migrator';
1010

1111
export class ButtonStylesMigrator extends StyleMigrator {
1212
component = 'button';
@@ -19,8 +19,8 @@ export class ButtonStylesMigrator extends StyleMigrator {
1919
'mdc-button-typography',
2020
'mdc-fab-theme',
2121
'mdc-fab-typography',
22-
'mdc-icon-theme',
23-
'mdc-icon-typography',
22+
'mdc-icon-button-theme',
23+
'mdc-icon-button-typography',
2424
],
2525
},
2626
];

src/material/schematics/ng-generate/mdc-migration/rules/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ButtonStylesMigrator} from './button-styles';
9+
import {ButtonStylesMigrator} from './components/button/button-styles';
1010
import {StyleMigrator} from './style-migrator';
1111

1212
export const MIGRATORS: StyleMigrator[] = [new ButtonStylesMigrator()];

0 commit comments

Comments
 (0)