Skip to content

Commit d603b8b

Browse files
devversionjelbourn
authored andcommitted
test(schematics): add test-case for attribute selectors data (#12728)
Adds the missing test-case for the attribute selectors data
1 parent 4879dc4 commit d603b8b

File tree

4 files changed

+71
-2
lines changed

4 files changed

+71
-2
lines changed

src/lib/schematics/update/test-cases/index.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ describe('test cases', () => {
1515
* a developers application.
1616
*/
1717
const testCases = [
18-
'v5/ts-class-names'
18+
'v5/attribute-selectors',
19+
'v5/ts-class-names',
1920
];
2021

2122
// Iterates through every test case directory and generates a jasmine test block that will
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {Component} from '@angular/core';
2+
import {By} from '@angular/platform-browser';
3+
4+
const a = By.css('[cdkPortalOutlet]');
5+
const b = By.css('[cdkPortalOutlet]');
6+
7+
// These should not change because we only update string literals that are
8+
// inside of a call expression.
9+
const c = 'cdkPortalHost';
10+
const d = 'portalHost';
11+
12+
@Component({
13+
template: `
14+
<div cdkPortalOutlet="E"></div>
15+
<div [cdkPortalOutlet]="myPortal"></div>
16+
`,
17+
styles: [
18+
'[cdkPortalOutlet] {background: red}',
19+
'div[cdkPortalOutlet] {color: blue}'
20+
]
21+
})
22+
class E {}
23+
24+
@Component({
25+
template: `
26+
<div cdkPortalOutlet="F"></div>
27+
<div [cdkPortalOutlet]="myPortal"></div>
28+
`,
29+
styles: [
30+
'[cdkPortalOutlet] {background: red}',
31+
'div[cdkPortalOutlet] {color: blue}'
32+
]
33+
})
34+
class F {}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {Component} from '@angular/core';
2+
import {By} from '@angular/platform-browser';
3+
4+
const a = By.css('[cdkPortalHost]');
5+
const b = By.css('[portalHost]');
6+
7+
// These should not change because we only update string literals that are
8+
// inside of a call expression.
9+
const c = 'cdkPortalHost';
10+
const d = 'portalHost';
11+
12+
@Component({
13+
template: `
14+
<div cdkPortalHost="E"></div>
15+
<div [cdkPortalHost]="myPortal"></div>
16+
`,
17+
styles: [
18+
'[cdkPortalHost] {background: red}',
19+
'div[cdkPortalHost] {color: blue}'
20+
]
21+
})
22+
class E {}
23+
24+
@Component({
25+
template: `
26+
<div portalHost="F"></div>
27+
<div [portalHost]="myPortal"></div>
28+
`,
29+
styles: [
30+
'[portalHost] {background: red}',
31+
'div[portalHost] {color: blue}'
32+
]
33+
})
34+
class F {}

tslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
}, "src/+(lib|cdk|material-experimental|cdk-experimental)/**/!(*.spec).ts"],
121121
"require-license-banner": [
122122
true,
123-
"src/+(lib|cdk|material-experimental|cdk-experimental|demo-app)/**/!(*.spec|*.fixture).ts"
123+
"src/+(lib|cdk|material-experimental|cdk-experimental|demo-app)/**/!(*.spec).ts"
124124
],
125125
"missing-rollup-globals": [
126126
true,

0 commit comments

Comments
 (0)