Skip to content

Commit

Permalink
test: use createTheme in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli committed Jun 3, 2022
1 parent eae09c5 commit a46cd9f
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions packages/mui-material/src/Stack/Stack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,24 +258,25 @@ describe('<Stack />', () => {
});

it('should generate correct styles if custom breakpoints are provided in theme', () => {
const customTheme = createTheme({
breakpoints: {
values: {
smallest: 0,
small: 375,
mobile: 600,
tablet: 992,
desktop: 1200,
},
},
});

expect(
style({
ownerState: {
direction: 'column',
spacing: 4,
},
theme: {
...defaultTheme,
breakpoints: {
values: {
smallest: 0,
small: 375,
mobile: 600,
tablet: 992,
desktop: 1200,
},
},
},
theme: customTheme,
}),
).to.deep.equal({
'& > :not(style) + :not(style)': {
Expand All @@ -288,22 +289,17 @@ describe('<Stack />', () => {
});

it('should generate correct responsive styles if custom responsive spacing values are provided', () => {
const breakpointsValues = {
smallest: 0,
small: 375,
mobile: 600,
tablet: 992,
desktop: 1200,
};

const customTheme = {
...defaultTheme,
const customTheme = createTheme({
breakpoints: {
values: breakpointsValues,
keys: ['smallest', 'small', 'mobile', 'tablet', 'desktop'],
up: (key) => `@media (min-width:${breakpointsValues[key]}px)`,
values: {
smallest: 0,
small: 375,
mobile: 600,
tablet: 992,
desktop: 1200,
},
},
};
});

expect(
style({
Expand Down

0 comments on commit a46cd9f

Please sign in to comment.