-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
conatiner_queries_spec.ts
40 lines (36 loc) 路 1.12 KB
/
conatiner_queries_spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ShadowCss} from '@angular/compiler/src/shadow_css';
describe('ShadowCss, container queries', () => {
function s(css: string, contentAttr: string, hostAttr: string = '') {
const shadowCss = new ShadowCss();
return shadowCss.shimCssText(css, contentAttr, hostAttr);
}
it('should scope normal selectors inside an unnamed container rules', () => {
const css = `
@container max(max-width: 500px) {
.item {
color: red;
}
}
`;
const result = s(css, 'host-a');
expect(result).toContain('.item[host-a] {');
});
it('should scope normal selectors inside a named container rules', () => {
const css = `
@container container max(max-width: 500px) {
.item {
color: red;
}
}
`;
const result = s(css, 'host-a');
expect(result).toContain('.item[host-a] {');
});
});