Skip to content

Commit bfbc48f

Browse files
committed
fix(app): correct test for styles, styleUrls, styleUrl
fix #1444
1 parent 2e36d95 commit bfbc48f

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

test/fixtures/todomvc-ng2/src/app/about/about.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ import { Subscription } from 'rxjs/Subscription';
2525
providers: [EmitterService],
2626
entryComponents: [TodoComponent, ListComponent],
2727
preserveWhitespaces: false,
28-
hostDirectives: [DoNothingDirective]
28+
hostDirectives: [DoNothingDirective],
29+
styles: `
30+
a {
31+
color: #03a9f4;
32+
}
33+
`
2934
})
3035
export class AboutComponent {
3136
public subscriptions: Subscription[];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a {
2+
color: green;
3+
}

test/fixtures/todomvc-ng2/src/app/about/compodoc/compodoc.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Component } from '@angular/core';
55
*/
66
@Component({
77
selector: 'compodoc',
8-
templateUrl: './compodoc.component.html'
8+
templateUrl: './compodoc.component.html',
9+
styleUrl: './compodoc.component.css'
910
})
1011
export class CompodocComponent {}

test/src/cli/cli-generation-big-app.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,4 +979,15 @@ describe('CLI simple generation - big app', () => {
979979
expect(file).to.contain('<a href="#label" >label</a>');
980980
expect(file).to.contain('<a href="#currentChange" >currentChange</a>');
981981
});
982+
983+
it('should support component styles url/urls', () => {
984+
let file = read(distFolder + '/components/CompodocComponent.html');
985+
expect(file).to.contain('<code>./compodoc.component.css</code>');
986+
file = read(distFolder + '/components/AboutComponent.html');
987+
expect(file).to.contain(`<code>
988+
a {
989+
color: #03a9f4;
990+
}
991+
</code>`);
992+
});
982993
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy