Skip to content

Commit 627a7a6

Browse files
desig9steinsimeonoffCopilot
authored
feat(migrations): add migration for circular theme to rename base circle color property (#17201)
* feat(migrations): add migration for circular theme to rename base circle color property * Update projects/igniteui-angular/migrations/update-21_2_0/index.spec.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor(migrations): update 21.2.0 migration files --------- Co-authored-by: Simeon Simeonoff <sim.simeonoff@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 024b8e8 commit 627a7a6

3 files changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$base-circle-color",
6+
"replaceWith": "$track-color",
7+
"owner": "circular-theme",
8+
"type": "property"
9+
}
10+
]
11+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import * as path from "path";
2+
3+
import {
4+
SchematicTestRunner,
5+
UnitTestTree,
6+
} from "@angular-devkit/schematics/testing";
7+
import { setupTestTree } from "../common/setup.spec";
8+
9+
const version = "21.2.0";
10+
const themes = ["circular-theme"];
11+
const testFilePath = "/testSrc/appPrefix/component/test.component.scss";
12+
13+
describe(`Update to ${version}`, () => {
14+
let appTree: UnitTestTree;
15+
const schematicRunner = new SchematicTestRunner(
16+
"ig-migrate",
17+
path.join(__dirname, "../migration-collection.json"),
18+
);
19+
20+
beforeEach(() => {
21+
appTree = setupTestTree();
22+
});
23+
24+
const migrationName = "migration-55";
25+
26+
themes.forEach((theme) => {
27+
it(`should rename the base circle color property of the circular progress for ${theme}`, async () => {
28+
appTree.create(
29+
testFilePath,
30+
`$custom-${theme}: ${theme}($base-circle-color: red);`,
31+
);
32+
33+
const tree = await schematicRunner.runSchematic(
34+
migrationName,
35+
{},
36+
appTree,
37+
);
38+
39+
expect(tree.readContent(testFilePath)).toEqual(
40+
`$custom-${theme}: ${theme}($track-color: red);`,
41+
);
42+
});
43+
});
44+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { Rule, SchematicContext, Tree } from "@angular-devkit/schematics";
2+
import { UpdateChanges } from "../common/UpdateChanges";
3+
4+
const version = "21.2.0";
5+
6+
export default (): Rule => async (host: Tree, context: SchematicContext) => {
7+
context.logger.info(
8+
`Applying migration for Ignite UI for Angular to version ${version}`,
9+
);
10+
const update = new UpdateChanges(__dirname, host, context);
11+
update.applyChanges();
12+
};

0 commit comments

Comments
 (0)