File tree Expand file tree Collapse file tree 3 files changed +82
-3
lines changed Expand file tree Collapse file tree 3 files changed +82
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ export class FilterButton extends FilteredList {
26
26
header ! : TemplateResult | string ;
27
27
@property ( )
28
28
icon ! : string ;
29
+ @property ( { type : Boolean } )
30
+ disabled = false ;
29
31
30
32
@query ( '#filterDialog' )
31
33
private filterDialog ! : Dialog ;
@@ -48,7 +50,11 @@ export class FilterButton extends FilteredList {
48
50
49
51
render ( ) : TemplateResult {
50
52
return html `
51
- <mwc- icon- butto n icon= "${ this . icon } " @click = ${ this . toggleList } >
53
+ <mwc- icon- butto n
54
+ icon= "${ this . icon } "
55
+ @click = "${ this . toggleList } "
56
+ ?dis abled= "${ this . disabled } "
57
+ >
52
58
<slot name= "icon" > </ slot>
53
59
</ mwc- icon- butto n>
54
60
<mwc- dialog
Original file line number Diff line number Diff line change 1
1
/* @web /test-runner snapshot v1 */
2
2
export const snapshots = { } ;
3
3
4
- snapshots [ "oscd-filter-button multi selection with custom header and standard icon looks like its latest snapshot" ] =
4
+ snapshots [ "oscd-filter-button multi selection with custom header and standard icon looks like its latest snapshot" ] =
5
5
`<mwc-icon-button icon="developer_board">
6
6
<slot name="icon">
7
7
</slot>
@@ -42,7 +42,7 @@ snapshots["oscd-filter-button multi selection with custom header and standard ic
42
42
` ;
43
43
/* end snapshot oscd-filter-button multi selection with custom header and standard icon looks like its latest snapshot */
44
44
45
- snapshots [ "oscd-filter-button single selection with default header and custom icon looks like its latest snapshot" ] =
45
+ snapshots [ "oscd-filter-button single selection with default header and custom icon looks like its latest snapshot" ] =
46
46
`<mwc-icon-button icon="undefined">
47
47
<slot name="icon">
48
48
</slot>
@@ -79,3 +79,47 @@ snapshots["oscd-filter-button single selection with default header and custom ic
79
79
` ;
80
80
/* end snapshot oscd-filter-button single selection with default header and custom icon looks like its latest snapshot */
81
81
82
+ snapshots [ "oscd-filter-button is disabled looks like its latest snapshot" ] =
83
+ `<mwc-icon-button
84
+ disabled=""
85
+ icon="developer_board"
86
+ >
87
+ <slot name="icon">
88
+ </slot>
89
+ </mwc-icon-button>
90
+ <mwc-dialog
91
+ heading="Filter Header"
92
+ id="filterDialog"
93
+ scrimclickaction=""
94
+ >
95
+ <div id="tfcontainer">
96
+ <abbr title="[filter]">
97
+ <mwc-textfield
98
+ icontrailing="search"
99
+ label=""
100
+ outlined=""
101
+ >
102
+ </mwc-textfield>
103
+ </abbr>
104
+ <mwc-formfield class="checkall">
105
+ <mwc-checkbox indeterminate="">
106
+ </mwc-checkbox>
107
+ </mwc-formfield>
108
+ </div>
109
+ <ul
110
+ class="mdc-deprecated-list"
111
+ tabindex="-1"
112
+ >
113
+ <slot>
114
+ </slot>
115
+ </ul>
116
+ <mwc-button
117
+ dialogaction="close"
118
+ slot="primaryAction"
119
+ >
120
+ [close]
121
+ </mwc-button>
122
+ </mwc-dialog>
123
+ ` ;
124
+ /* end snapshot oscd-filter-button is disabled looks like its latest snapshot */
125
+
Original file line number Diff line number Diff line change @@ -141,4 +141,33 @@ describe('oscd-filter-button', () => {
141
141
await expect ( element ) . shadowDom . to . equalSnapshot ( ) ;
142
142
} ) ;
143
143
} ) ;
144
+
145
+ describe ( 'is disabled' , ( ) => {
146
+ beforeEach ( async ( ) => {
147
+ element = await fixture (
148
+ html `< oscd-filter-button
149
+ id ="filter "
150
+ icon ="developer_board "
151
+ header ="Filter Header "
152
+ disabled ="true "
153
+ >
154
+ ${ Array . from ( listItems ) . map (
155
+ item =>
156
+ html ` < mwc-check-list-item
157
+ value ="${ item . prim } "
158
+ ?selected ="${ item . defaultSelected } "
159
+ >
160
+ < span > ${ item . prim } </ span >
161
+ </ mwc-check-list-item > `
162
+ ) }
163
+ </ oscd-filter-button > `
164
+ ) ;
165
+ await element . requestUpdate ( ) ;
166
+ await element . updateComplete ;
167
+ } ) ;
168
+
169
+ it ( 'looks like its latest snapshot' , async ( ) => {
170
+ await expect ( element ) . shadowDom . to . equalSnapshot ( ) ;
171
+ } ) ;
172
+ } ) ;
144
173
} ) ;
You can’t perform that action at this time.
0 commit comments