|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`style-objects.ts 1`] = ` |
| 4 | + |
| 5 | +File: style-objects.ts |
| 6 | +Source code: |
| 7 | + |
| 8 | + declare const styled: any; |
| 9 | + |
| 10 | + const Button = styled.button({ |
| 11 | + color: 'red' |
| 12 | + }); |
| 13 | + |
| 14 | + declare const nonStyled: any; |
| 15 | + |
| 16 | + const NonButton = nonStyled.button({ |
| 17 | + color: 'red' |
| 18 | + }); |
| 19 | + |
| 20 | + const OtherButton = styled(Button)({ |
| 21 | + color: 'blue' |
| 22 | + }); |
| 23 | + |
| 24 | + const SuperButton = Button.extend({ |
| 25 | + color: 'super' |
| 26 | + }); |
| 27 | + |
| 28 | + export default styled.link({ |
| 29 | + color: 'black' |
| 30 | + }); |
| 31 | + |
| 32 | + export const SmallButton = Button.extend({ |
| 33 | + fontSize: '.7em' |
| 34 | + }); |
| 35 | + |
| 36 | + const MiniButton = styled(SmallButton).attrs({ size: 'mini' })({ |
| 37 | + fontSize: '.1em' |
| 38 | + }); |
| 39 | + |
| 40 | + |
| 41 | +TypeScript before transform: |
| 42 | + |
| 43 | + declare const styled: any; |
| 44 | + const Button = styled.button({ |
| 45 | + color: "red" |
| 46 | + }); |
| 47 | + declare const nonStyled: any; |
| 48 | + const NonButton = nonStyled.button({ |
| 49 | + color: "red" |
| 50 | + }); |
| 51 | + const OtherButton = styled(Button)({ |
| 52 | + color: "blue" |
| 53 | + }); |
| 54 | + const SuperButton = Button.extend({ |
| 55 | + color: "super" |
| 56 | + }); |
| 57 | + export default styled.link({ |
| 58 | + color: "black" |
| 59 | + }); |
| 60 | + export const SmallButton = Button.extend({ |
| 61 | + fontSize: ".7em" |
| 62 | + }); |
| 63 | + const MiniButton = styled(SmallButton).attrs({ size: "mini" })({ |
| 64 | + fontSize: ".1em" |
| 65 | + }); |
| 66 | + |
| 67 | + |
| 68 | +TypeScript after transform: |
| 69 | + |
| 70 | + declare const styled: any; |
| 71 | + const Button = styled.button.withConfig({ displayName: "Button", componentId: "sc-7b7p9e" })({ |
| 72 | + color: 'red' |
| 73 | + }); |
| 74 | + declare const nonStyled: any; |
| 75 | + const NonButton = nonStyled.button({ |
| 76 | + color: 'red' |
| 77 | + }); |
| 78 | + const OtherButton = styled(Button).withConfig({ displayName: "OtherButton", componentId: "sc-14ah7t" })({ |
| 79 | + color: 'blue' |
| 80 | + }); |
| 81 | + const SuperButton = Button.extend.withConfig({ displayName: "SuperButton", componentId: "sc-1t5v351" })({ |
| 82 | + color: 'super' |
| 83 | + }); |
| 84 | + export default styled.link({ |
| 85 | + color: 'black' |
| 86 | + }); |
| 87 | + export const SmallButton = Button.extend.withConfig({ displayName: "SmallButton", componentId: "sc-ftk9hu" })({ |
| 88 | + fontSize: '.7em' |
| 89 | + }); |
| 90 | + const MiniButton = styled(SmallButton).attrs({ size: "mini" }).withConfig({ displayName: "MiniButton", componentId: "sc-15rszef" })({ |
| 91 | + fontSize: '.1em' |
| 92 | + }); |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +`; |
0 commit comments