Skip to content

Commit

Permalink
test: maintain test after removing jsdom
Browse files Browse the repository at this point in the history
  • Loading branch information
DNR500 committed Sep 11, 2024
1 parent e666cb8 commit a47a459
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 294 deletions.
1 change: 0 additions & 1 deletion packages/widget-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"cpy-cli": "^5.0.0",
"jsdom": "^24.1.3",
"typescript": "^5.6.2",
"vite": "^5.4.4",
"vitest": "^2.0.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,15 @@ import { stringifyConfig } from './stringifyConfig';

const expected = `const config = {
walletConfig: {
async onConnect () {}
},
some: {
loose: async ()=>{}
},
else: {
loose: async function() {}
},
components: {
MuiCard: {
defaultProps: {
variant: "elevation"
async onConnect() {
}
},
MuiIconButton: {
styleOverrides: {
somethingElse: "here",
root: ()=>({
backgroundColor: \`#000000\`,
color: 'inherit',
borderRadius: 12,
'&:hover': {
backgroundColor: '#ffffff',
color: 'inherit'
}
})
}
}
}
}`;

describe('stringifyConfig', () => {
test('should be able to add a string representation of a function', () => {
const config = {
walletConfig: { async onConnect() {} },
some: { loose: async () => {} },
else: { loose: async function () {} },
components: {
MuiCard: {
defaultProps: { variant: 'elevation' },
},
MuiIconButton: {
styleOverrides: {
somethingElse: 'here',
root: () => ({
backgroundColor: `#000000`,
color: 'inherit',
borderRadius: 12,
'&:hover': {
backgroundColor: '#ffffff',
color: 'inherit',
},
}),
},
},
},
};

expect(stringifyConfig(config)).toEqual(expected);
Expand Down
Loading

0 comments on commit a47a459

Please sign in to comment.