-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(carousel): add migration for CarouselAnimationType
- add leaveAnimationDone and enterAnimationDone events - rename animationDuration Co-authored-by: MonikaKirkova <[email protected]>
- Loading branch information
1 parent
139d306
commit 555088c
Showing
8 changed files
with
123 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
projects/igniteui-angular/migrations/update-13_0_0/changes/classes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "../../common/schema/class.schema.json", | ||
"changes": [{ | ||
"name": "CarouselAnimationType", | ||
"replaceWith": "HorizontalAnimationType" | ||
} | ||
] | ||
} |
70 changes: 70 additions & 0 deletions
70
projects/igniteui-angular/migrations/update-13_0_0/index.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import * as path from 'path'; | ||
|
||
import { EmptyTree } from '@angular-devkit/schematics'; | ||
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; | ||
|
||
const version = '13.0.0'; | ||
|
||
describe(`Update to ${version}`, () => { | ||
let appTree: UnitTestTree; | ||
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json')); | ||
const configJson = { | ||
defaultProject: 'testProj', | ||
projects: { | ||
testProj: { | ||
sourceRoot: '/testSrc' | ||
} | ||
}, | ||
schematics: { | ||
'@schematics/angular:component': { | ||
prefix: 'appPrefix' | ||
} | ||
} | ||
}; | ||
|
||
const migrationName = 'migration-22'; | ||
|
||
beforeEach(() => { | ||
appTree = new UnitTestTree(new EmptyTree()); | ||
appTree.create('/angular.json', JSON.stringify(configJson)); | ||
}); | ||
|
||
it('should rename CarouselAnimationType to HorizontalAnimationType', async () => { | ||
appTree.create( | ||
'/testSrc/appPrefix/component/test.component.ts', | ||
`import { Component, ViewChild } from '@angular/core'; | ||
import { CarouselAnimationType } from 'igniteui-angular'; | ||
@Component({ | ||
selector: 'animationType', | ||
templateUrl: './test.component.html', | ||
styleUrls: ['./test.component.scss'] | ||
}) | ||
export class AnimationType { | ||
public animationType: CarouselAnimationType = CarouselAnimationType.slide; | ||
} | ||
`); | ||
const tree = await schematicRunner | ||
.runSchematicAsync(migrationName, {}, appTree) | ||
.toPromise(); | ||
|
||
const expectedContent = `import { Component, ViewChild } from '@angular/core'; | ||
import { HorizontalAnimationType } from 'igniteui-angular'; | ||
@Component({ | ||
selector: 'animationType', | ||
templateUrl: './test.component.html', | ||
styleUrls: ['./test.component.scss'] | ||
}) | ||
export class AnimationType { | ||
public animationType: HorizontalAnimationType = HorizontalAnimationType.slide; | ||
} | ||
`; | ||
|
||
expect( | ||
tree.readContent( | ||
'/testSrc/appPrefix/component/test.component.ts' | ||
) | ||
).toEqual(expectedContent); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
projects/igniteui-angular/migrations/update-13_0_0/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; | ||
import { UpdateChanges } from '../common/UpdateChanges'; | ||
|
||
const version = '13.0.0'; | ||
|
||
export default (): Rule => (host: Tree, context: SchematicContext) => { | ||
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`); | ||
|
||
const update = new UpdateChanges(__dirname, host, context); | ||
update.applyChanges(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters