File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed
Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ import PgButton from '@pictogrammers/components/pg/button';
3838| ` --pg-button-active-color ` | ` #fff ` | ` active ` Text color |
3939| ` --pg-button-active-background-color ` | ` #453C4F ` | ` active ` Background color |
4040| ` --pg-button-active-border-color ` | ` #453C4F ` | ` active ` Border color |
41+ | ` --pg-button-padding ` | ` 0.25rem 0.5rem ` | Padding. |
42+ | ` --pg-button-font-size ` | ` 1rem ` | Font size. |
43+ | ` --pg-button-line-height ` | ` 1.5rem ` | Line height. |
4144
4245### Slots
4346
Original file line number Diff line number Diff line change 77 align-items : center;
88 align-content : center;
99 font-family : var (--pg-font-family );
10- font-size : 1rem ;
11- line-height : 1.5rem ;
10+ font-size : var ( --pg-button-font-size , 1rem ) ;
11+ line-height : var ( --pg-button-line-height , 1.5rem ) ;
1212 border : 1px solid var (--pg-button-border-color , # 453C4F );
1313 background-color : var (--pg-button-background-color , # fff );
1414 color : var (--pg-button-color , # 453C4F );
Original file line number Diff line number Diff line change 1+ import { selectComponent , getProps } from '@pictogrammers/element' ;
2+
3+ import './button' ;
4+ import PgButton from './button' ;
5+
6+ const PG_BUTTON = 'pg-button' ;
7+
8+ describe ( 'pg-button' , ( ) => {
9+
10+ beforeEach ( ( ) => {
11+ var c = document . createElement ( PG_BUTTON ) ;
12+ document . body . appendChild ( c ) ;
13+ } ) ;
14+
15+ afterEach ( ( ) => {
16+ while ( document . body . firstChild ) {
17+ document . body . removeChild ( document . body . firstChild ) ;
18+ }
19+ } ) ;
20+
21+ it ( 'should be registered' , ( ) => {
22+ expect ( customElements . get ( PG_BUTTON ) ) . toBeDefined ( ) ;
23+ } ) ;
24+
25+ it ( 'should only expose known props' , ( ) => {
26+ const props = getProps ( PG_BUTTON ) ;
27+ expect ( props . length ) . toBe ( 5 ) ;
28+ expect ( props ) . toContain ( 'active' ) ;
29+ expect ( props ) . toContain ( 'block' ) ;
30+ expect ( props ) . toContain ( 'start' ) ;
31+ expect ( props ) . toContain ( 'center' ) ;
32+ expect ( props ) . toContain ( 'end' ) ;
33+ } ) ;
34+
35+ } ) ;
You can’t perform that action at this time.
0 commit comments