File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
packages/components/test/components Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ import { render } from '@asyncapi/generator-react-sdk' ;
2+ import { Installation } from '../../src/components/readme/Installation' ;
3+
4+ describe ( 'Installation component' , ( ) => {
5+ test ( 'renders javascript installation command' , ( ) => {
6+ const result = render ( < Installation language = "javascript" /> ) ;
7+ expect ( result . trim ( ) ) . toMatchSnapshot ( ) ;
8+ } ) ;
9+
10+ test ( 'renders python installation command' , ( ) => {
11+ const result = render ( < Installation language = "python" /> ) ;
12+ expect ( result . trim ( ) ) . toMatchSnapshot ( ) ;
13+ } ) ;
14+
15+ test ( 'renders installation section when language is undefined' , ( ) => {
16+ const result = render ( < Installation /> ) ;
17+ const output = result . trim ( ) ;
18+
19+ // Explicitly document current behavior
20+ expect ( output ) . toContain ( '## Installation' ) ;
21+ expect ( output ) . toContain ( 'Install dependencies' ) ;
22+ expect ( output ) . toContain ( 'undefined' ) ;
23+ } ) ;
24+ } ) ;
Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+ exports [` Installation component renders javascript installation command 1` ] = `
4+ "## Installation
5+
6+ Install dependencies:
7+
8+ \`\`\` bash
9+ npm install
10+ \`\`\` "
11+ ` ;
12+
13+ exports [` Installation component renders python installation command 1` ] = `
14+ "## Installation
15+
16+ Install dependencies:
17+
18+ \`\`\` bash
19+ pip install -r requirements.txt
20+ \`\`\` "
21+ ` ;
You can’t perform that action at this time.
0 commit comments