Skip to content

Commit 8f3144e

Browse files
committed
Fix grid related issues in safari
1 parent 4e8de65 commit 8f3144e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

packages/material-ui/src/ImageList/ImageList.test.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,26 @@ describe('<ImageList />', () => {
188188
});
189189
});
190190

191-
describe('prop: gap', () => {
192-
it('should render with modified grid-template-columns style', () => {
191+
describe.only('prop: gap', () => {
192+
it('should render with modified grid-template-columns style', function test() {
193+
if (/jsdom/.test(window.navigator.userAgent)) {
194+
this.skip();
195+
}
196+
193197
const { getByTestId } = render(
194198
<ImageList data-testid="test-root" gap={8}>
195199
{children}
196200
</ImageList>,
197201
);
198202

199-
expect(getByTestId('test-root').style.gap).to.equal('8px');
203+
expect(window.getComputedStyle(getByTestId('test-root'))).to.include({
204+
rowGap: '8px',
205+
columnGap: '8px',
206+
});
200207
});
201208

202209
it('should render with modified column-gap style', function test() {
203-
if (!/jsdom/.test(window.navigator.userAgent)) {
210+
if (/jsdom/.test(window.navigator.userAgent)) {
204211
this.skip();
205212
}
206213

@@ -210,7 +217,10 @@ describe('<ImageList />', () => {
210217
</ImageList>,
211218
);
212219

213-
expect(getByTestId('test-root').style['column-gap']).to.equal('8px');
220+
expect(window.getComputedStyle(getByTestId('test-root'))).to.have.property(
221+
'columnGap',
222+
'8px',
223+
);
214224
});
215225
});
216226
});

0 commit comments

Comments
 (0)