@@ -8,21 +8,23 @@ import Brand from './Brand';
88describe ( '<Brand/>' , ( ) => {
99 it ( 'should render as expected' , ( ) => {
1010 const blackLogoSnapshot = renderer
11- . create ( < Brand asset = "glints-black" /> )
11+ . create ( < Brand asset = "glints-black" variant = "square" /> )
1212 . toJSON ( ) ;
1313 expect ( blackLogoSnapshot ) . toMatchSnapshot ( ) ;
14- const white = renderer . create ( < Brand asset = "glints-white" /> ) . toJSON ( ) ;
14+ const white = renderer
15+ . create ( < Brand asset = "glints-white" variant = "square" /> )
16+ . toJSON ( ) ;
1517 expect ( white ) . toMatchSnapshot ( ) ;
1618 const blackTapLoker = renderer
17- . create ( < Brand asset = "glints-taploker-black" /> )
19+ . create ( < Brand asset = "glints-taploker-black" variant = "square" /> )
1820 . toJSON ( ) ;
1921 expect ( blackTapLoker ) . toMatchSnapshot ( ) ;
2022 const whiteTapLoker = renderer
21- . create ( < Brand asset = "glints-taploker-white" /> )
23+ . create ( < Brand asset = "glints-taploker-white" variant = "square" /> )
2224 . toJSON ( ) ;
2325 expect ( whiteTapLoker ) . toMatchSnapshot ( ) ;
2426 const cutsom = renderer
25- . create ( < Brand asset = "http://example.com/example.jpg" /> )
27+ . create ( < Brand asset = "http://example.com/example.jpg" variant = "square" /> )
2628 . toJSON ( ) ;
2729 expect ( cutsom ) . toMatchSnapshot ( ) ;
2830 } ) ;
@@ -33,7 +35,7 @@ describe('<Brand/>', () => {
3335
3436 const url = 'https://glints.com' ;
3537 const { getByRole } = render (
36- < Brand asset = "glints-black" rightClickURL = { url } />
38+ < Brand asset = "glints-black" rightClickURL = { url } variant = "square" />
3739 ) ;
3840 const container = getByRole ( 'presentation' ) ;
3941 fireEvent . contextMenu ( container ) ;
@@ -51,11 +53,35 @@ describe('<Brand/>', () => {
5153 asset = "glints-black"
5254 rightClickURL = { url }
5355 onContextMenu = { onContextMenu }
56+ variant = "square"
5457 />
5558 ) ;
5659 const container = getByRole ( 'presentation' ) ;
5760 expect ( onContextMenu ) . toHaveBeenCalledTimes ( 0 ) ;
5861 fireEvent . contextMenu ( container ) ;
5962 expect ( onContextMenu ) . toHaveBeenCalledTimes ( 1 ) ;
6063 } ) ;
64+ it ( 'should render with correct styles based on variant' , ( ) => {
65+ const { container : defaultContainer } = render ( < Brand asset = "glints" /> ) ;
66+ expect ( defaultContainer . querySelector ( '.brand-image' ) ) . toHaveStyleRule (
67+ 'width' ,
68+ '5em'
69+ ) ;
70+
71+ const { container : horizontalContainer } = render (
72+ < Brand asset = "glints" variant = "horizontal" />
73+ ) ;
74+ expect ( horizontalContainer . querySelector ( '.brand-image' ) ) . toHaveStyleRule (
75+ 'width' ,
76+ '5em'
77+ ) ;
78+
79+ const { container : squareContainer } = render (
80+ < Brand asset = "glints-black" variant = "square" />
81+ ) ;
82+ expect ( squareContainer . querySelector ( '.brand-image' ) ) . toHaveStyleRule (
83+ 'width' ,
84+ '3em'
85+ ) ;
86+ } ) ;
6187} ) ;
0 commit comments