File tree Expand file tree Collapse file tree
components/Article/BlockQuote Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+ exports [` BlockQuote component should render correctly 1` ] = `
4+ <div >
5+ <div
6+ class = " blockQuote"
7+ />
8+ </div >
9+ ` ;
10+
11+ exports [` BlockQuote component should support passing children into the component 1` ] = `
12+ <div >
13+ <div
14+ class = " blockQuote"
15+ >
16+ This is a block quote
17+ </div >
18+ </div >
19+ ` ;
20+
21+ exports [` BlockQuote component should support passing multiple children into the component 1` ] = `
22+ <div >
23+ <div
24+ class = " blockQuote"
25+ >
26+ <p >
27+ This is a block quote
28+ </p >
29+ <p >
30+ This is a block quote
31+ </p >
32+ </div >
33+ </div >
34+ ` ;
Original file line number Diff line number Diff line change 1+ import { render } from '@testing-library/react' ;
2+ import BlockQuote from '../index' ;
3+
4+ describe ( 'BlockQuote component' , ( ) => {
5+ it ( 'should render correctly' , ( ) => {
6+ const { container } = render ( < BlockQuote /> ) ;
7+
8+ expect ( container ) . toMatchSnapshot ( ) ;
9+ } ) ;
10+
11+ it ( 'should support passing children into the component' , ( ) => {
12+ const { container } = render (
13+ < BlockQuote > This is a block quote</ BlockQuote >
14+ ) ;
15+
16+ expect ( container ) . toMatchSnapshot ( ) ;
17+ } ) ;
18+
19+ it ( 'should support passing multiple children into the component' , ( ) => {
20+ const { container } = render (
21+ < BlockQuote >
22+ < p > This is a block quote</ p >
23+ < p > This is a block quote</ p >
24+ </ BlockQuote >
25+ ) ;
26+
27+ expect ( container ) . toMatchSnapshot ( ) ;
28+ } ) ;
29+ } ) ;
Original file line number Diff line number Diff line change 1+ .blockQuote {
2+ background-color : var (--color-fill-banner );
3+ border-radius : 5px ;
4+ color : var (--color-text-primary );
5+ font-size : var (--font-size-body1 );
6+ margin : var (--space-16 ) auto ;
7+ max-width : 90vw ;
8+ padding : var (--space-12 );
9+ position : relative ;
10+
11+ @media (max-width : 900px ) {
12+ margin : var (--space-08 ) auto ;
13+ }
14+
15+ p :last-child {
16+ margin : 0 ;
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ import BlockQuote from './index' ;
2+
3+ export default { component : BlockQuote } ;
4+
5+ export const Default = {
6+ args : {
7+ children : 'This is a block quote' ,
8+ } ,
9+ } ;
10+
11+ export const MultipleParagraph = {
12+ args : {
13+ children : [
14+ < p key = { 1 } > This is a block quote 1</ p > ,
15+ < p key = { 2 } > This is a block quote 2</ p > ,
16+ ] ,
17+ } ,
18+ } ;
Original file line number Diff line number Diff line change 1+ import type { PropsWithChildren } from 'react' ;
2+ import styles from './index.module.scss' ;
3+
4+ const BlockQuote = ( { children } : PropsWithChildren ) => (
5+ < div className = { styles . blockQuote } > { children } </ div >
6+ ) ;
7+
8+ export default BlockQuote ;
You can’t perform that action at this time.
0 commit comments