File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 11import { newSpecPage } from '@stencil/core/testing' ;
22
3+ import { Buttons } from '../../components/buttons/buttons' ;
34import { CardContent } from '../../components/card-content/card-content' ;
45import { Chip } from '../../components/chip/chip' ;
56import {
@@ -284,6 +285,20 @@ describe('injectCSS', () => {
284285
285286 expect ( shadowRoot ! . innerHTML ) . toContain ( `<style>${ css } </style>` ) ;
286287 } ) ;
288+
289+ it ( 'should inject CSS into a scoped element' , async ( ) => {
290+ const page = await newSpecPage ( {
291+ components : [ Buttons ] ,
292+ html : '<ion-buttons></ion-buttons>' ,
293+ } ) ;
294+
295+ const target = page . body . querySelector ( 'ion-buttons' ) ! ;
296+
297+ const css = ':host { background-color: red; }' ;
298+ injectCSS ( css , target ) ;
299+
300+ expect ( target . innerHTML ) . toContain ( `<style>${ css } </style>` ) ;
301+ } ) ;
287302} ) ;
288303
289304describe ( 'generateGlobalThemeCSS' , ( ) => {
You can’t perform that action at this time.
0 commit comments