@@ -69,38 +69,38 @@ describe('hide directive', () => {
69
69
70
70
it ( 'should initial with component not visible as default' , ( ) => {
71
71
createTestComponent ( `<div fxHide></div>` ) ;
72
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
72
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
73
73
} ) ;
74
74
75
75
it ( 'should initial with component visible when set to `false`' , ( ) => {
76
76
createTestComponent ( `<div fxHide="false"></div>` ) ;
77
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
77
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
78
78
} ) ;
79
79
80
80
it ( 'should initial with component visible when set to `0`' , ( ) => {
81
81
createTestComponent ( `<div [fxHide]="isVisible"></div>` ) ;
82
- expectNativeEl ( fixture , { isVisible : 0 } ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
82
+ expectNativeEl ( fixture , { isVisible : 0 } ) . toHaveStyle ( { 'display' : 'block' } ) ;
83
83
} ) ;
84
84
85
85
it ( 'should update styles with binding changes' , ( ) => {
86
86
createTestComponent ( `<div [fxHide]="menuHidden"></div>` ) ;
87
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
87
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
88
88
fixture . componentInstance . toggleMenu ( ) ;
89
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
89
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
90
90
fixture . componentInstance . toggleMenu ( ) ;
91
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
91
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
92
92
} ) ;
93
93
94
94
it ( 'should use "block" display style when not explicitly defined' , ( ) => {
95
95
createTestComponent ( `<button [fxHide]="isHidden"></button>` ) ;
96
- expectNativeEl ( fixture , { isHidden : true } ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
97
- expectNativeEl ( fixture , { isHidden : false } ) . toHaveCssStyle ( { 'display' : 'inline-block' } ) ;
96
+ expectNativeEl ( fixture , { isHidden : true } ) . toHaveStyle ( { 'display' : 'none' } ) ;
97
+ expectNativeEl ( fixture , { isHidden : false } ) . toHaveStyle ( { 'display' : 'inline-block' } ) ;
98
98
} ) ;
99
99
100
100
it ( 'should use "flex" display style when the element also has an fxLayout' , ( ) => {
101
101
createTestComponent ( `<div fxLayout [fxHide]="isHidden"></div>` ) ;
102
- expectNativeEl ( fixture , { isHidden : true } ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
103
- expectNativeEl ( fixture , { isHidden : false } ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
102
+ expectNativeEl ( fixture , { isHidden : true } ) . toHaveStyle ( { 'display' : 'none' } ) ;
103
+ expectNativeEl ( fixture , { isHidden : false } ) . toHaveStyle ( { 'display' : 'block' } ) ;
104
104
} ) ;
105
105
106
106
@@ -111,73 +111,73 @@ describe('hide directive', () => {
111
111
it ( 'should show on `xs` viewports only when the default is included' , ( ) => {
112
112
createTestComponent ( `<div fxHide="" fxHide.xs="false"></div>` ) ;
113
113
114
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
114
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
115
115
matchMedia . activate ( 'xs' ) ;
116
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
116
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
117
117
matchMedia . activate ( 'md' ) ;
118
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
118
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
119
119
} ) ;
120
120
121
121
it ( 'should preserve display and update only on activated mediaQuery' , ( ) => {
122
122
createTestComponent ( `<div [fxHide.xs]="isHidden" style="display:inline-block"></div>` ) ;
123
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'inline-block' } ) ;
123
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'inline-block' } ) ;
124
124
125
125
// should hide with this activation
126
126
matchMedia . activate ( 'xs' ) ;
127
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
127
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
128
128
129
129
// should reset to original display style
130
130
matchMedia . activate ( 'md' ) ;
131
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'inline-block' } ) ;
131
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'inline-block' } ) ;
132
132
} ) ;
133
133
134
134
it ( 'should restore original display when disabled' , ( ) => {
135
135
createTestComponent ( `<div [fxHide.xs]="isHidden" style="display:inline-block"></div>` ) ;
136
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'inline-block' } ) ;
136
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'inline-block' } ) ;
137
137
138
138
// should hide with this activation
139
139
matchMedia . activate ( 'xs' ) ;
140
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
140
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
141
141
142
142
// should reset to original display style
143
143
fixture . componentInstance . isHidden = false ;
144
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'inline-block' } ) ;
144
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'inline-block' } ) ;
145
145
} ) ;
146
146
147
147
it ( 'should restore original display when the mediaQuery deactivates' , ( ) => {
148
148
let originalDisplay = { 'display' : 'table' } ;
149
149
createTestComponent ( `<div [fxHide.xs]="isHidden" style="display:table"></div>` ) ;
150
- expectNativeEl ( fixture ) . toHaveCssStyle ( originalDisplay ) ;
150
+ expectNativeEl ( fixture ) . toHaveStyle ( originalDisplay ) ;
151
151
152
152
// should hide with this activation
153
153
matchMedia . activate ( 'xs' ) ;
154
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
154
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
155
155
156
156
// should reset to original display style
157
157
matchMedia . activate ( 'md' ) ;
158
- expectNativeEl ( fixture ) . toHaveCssStyle ( originalDisplay ) ;
158
+ expectNativeEl ( fixture ) . toHaveStyle ( originalDisplay ) ;
159
159
} ) ;
160
160
161
161
it ( 'should support use of the `media` observable in templates ' , ( ) => {
162
162
createTestComponent ( `<div [fxHide]="media.isActive('xs')"></div>` ) ;
163
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
163
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
164
164
165
165
matchMedia . activate ( 'xs' ) ;
166
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
166
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
167
167
168
168
matchMedia . activate ( 'lg' ) ;
169
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
169
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
170
170
} ) ;
171
171
172
172
it ( 'should support use of the `media` observable in adaptive templates ' , ( ) => {
173
173
createTestComponent ( `<div fxHide="false" [fxHide.md]="media.isActive('xs')"></div>` ) ;
174
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
174
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
175
175
176
176
matchMedia . activate ( 'xs' ) ;
177
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
177
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
178
178
179
179
matchMedia . activate ( 'md' ) ;
180
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
180
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'block' } ) ;
181
181
} ) ;
182
182
183
183
it ( 'should hide when used with fxLayout and the ".md" breakpoint activates' , ( ) => {
@@ -198,8 +198,8 @@ describe('hide directive', () => {
198
198
` ;
199
199
let expectActivation = makeExpectWithActivation ( createTestComponent ( template ) , '.hideOnMd' ) ;
200
200
201
- expectActivation ( ) . toHaveCssStyle ( { 'display' : 'block' } ) ;
202
- expectActivation ( 'md' ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
201
+ expectActivation ( ) . toHaveStyle ( { 'display' : 'block' } ) ;
202
+ expectActivation ( 'md' ) . toHaveStyle ( { 'display' : 'none' } ) ;
203
203
} ) ;
204
204
205
205
it ( 'should restore proper display mode when not hiding' , ( ) => {
@@ -210,9 +210,9 @@ describe('hide directive', () => {
210
210
` ;
211
211
let expectActivation = makeExpectWithActivation ( createTestComponent ( template ) , '.hideOnXs' ) ;
212
212
213
- expectActivation ( ) . toHaveCssStyle ( { 'display' : 'inline' } ) ;
214
- expectActivation ( 'xs' ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
215
- expectActivation ( 'md' ) . toHaveCssStyle ( { 'display' : 'inline' } ) ;
213
+ expectActivation ( ) . toHaveStyle ( { 'display' : 'inline' } ) ;
214
+ expectActivation ( 'xs' ) . toHaveStyle ( { 'display' : 'none' } ) ;
215
+ expectActivation ( 'md' ) . toHaveStyle ( { 'display' : 'inline' } ) ;
216
216
} ) ;
217
217
} ) ;
218
218
@@ -222,13 +222,13 @@ describe('hide directive', () => {
222
222
This content to be shown ONLY when gt-sm
223
223
</div>
224
224
` ) ;
225
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'inline-block' } ) ;
225
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'inline-block' } ) ;
226
226
227
227
matchMedia . activate ( 'md' , true ) ;
228
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'none' } ) ;
228
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'none' } ) ;
229
229
230
230
matchMedia . activate ( 'xs' , true ) ;
231
- expectNativeEl ( fixture ) . toHaveCssStyle ( { 'display' : 'inline-block' } ) ;
231
+ expectNativeEl ( fixture ) . toHaveStyle ( { 'display' : 'inline-block' } ) ;
232
232
} ) ;
233
233
234
234
} ) ;
0 commit comments