@@ -7,7 +7,7 @@ import React, { useState, useContext } from 'react';
77import ReactModal from 'react-modal' ;
88import styles from './ExportFileModal.module.scss' ;
99import { useCopy , useNewTest , useGenerateScript } from './modalHooks' ;
10- import { setTabIndex , } from '../../context/actions/globalActions' ;
10+ import { setTabIndex , } from '../../context/actions/globalActions' ;
1111// Accordion view
1212import Accordion from '@material-ui/core/Accordion' ;
1313import AccordionSummary from '@material-ui/core/AccordionSummary' ;
@@ -68,7 +68,7 @@ const Modal = ({
6868 }
6969
7070 const changeDirectory = ( ) => {
71- ipc . send ( 'terminal.toTerm' , `" ${ script . cd } " ${ execute } ` ) ;
71+ ipc . send ( 'terminal.toTerm' , `${ script . cd } ${ execute } ` ) ;
7272 setBtnFeedback ( { ...btnFeedback , changedDir : true } ) ;
7373 } ;
7474
@@ -100,36 +100,36 @@ const Modal = ({
100100 if ( title === 'New Test' ) {
101101 return (
102102 < ReactModal
103- className = { styles . modal }
104- isOpen = { isModalOpen }
105- onRequestClose = { closeModal }
106- contentLabel = "Save?"
107- shouldCloseOnOverlayClick = { true }
108- shouldCloseOnEsc = { true }
109- ariaHideApp = { false }
110- style = { {
111- content : {
112- top : '20%' ,
113- left : isFileDirectoryOpen ? '22%' : '11%' ,
114- } ,
115- overlay : {
116- zIndex : 3 ,
117- left : isFileDirectoryOpen ? '276px' : '46px' ,
118- minWidth : isFileDirectoryOpen ? '600px' : '600px' ,
119- width : isFileDirectoryOpen ? 'calc(59.9% - 276px)' : 'calc(49.9% - 46px)' ,
120- } ,
121- } } >
103+ className = { styles . modal }
104+ isOpen = { isModalOpen }
105+ onRequestClose = { closeModal }
106+ contentLabel = "Save?"
107+ shouldCloseOnOverlayClick = { true }
108+ shouldCloseOnEsc = { true }
109+ ariaHideApp = { false }
110+ style = { {
111+ content : {
112+ top : '20%' ,
113+ left : isFileDirectoryOpen ? '22%' : '11%' ,
114+ } ,
115+ overlay : {
116+ zIndex : 3 ,
117+ left : isFileDirectoryOpen ? '276px' : '46px' ,
118+ minWidth : isFileDirectoryOpen ? '600px' : '600px' ,
119+ width : isFileDirectoryOpen ? 'calc(59.9% - 276px)' : 'calc(49.9% - 46px)' ,
120+ } ,
121+ } } >
122122 < div id = { styles . title } >
123123 < p > { title } </ p >
124124 </ div >
125125
126126 < div id = { styles . body } >
127127 < p id = { styles . text } >
128128 Do you want to start a new test? All unsaved changes
129- < br />
129+ < br />
130130 will be lost.
131131 </ p >
132- < span id = { styles . newTestButtons } style = { { justifyContent : 'center' , alignItems : 'center' } } >
132+ < span id = { styles . newTestButtons } style = { { justifyContent : 'center' , alignItems : 'center' } } >
133133 < button id = { styles . save } onClick = { handleNewTest } >
134134 { title }
135135 </ button >
@@ -139,9 +139,39 @@ const Modal = ({
139139 </ span >
140140 </ div >
141141 </ ReactModal >
142- ) ;
142+ ) ;
143143 }
144144
145+
146+ const EndPointGuide = ( ) => {
147+ // endpoint guide only exists when user is in endpoint testing
148+ if ( script . endPointGuide ) {
149+ const array = [ ] ;
150+ for ( let step in script . endPointGuide ) {
151+ array . push ( < div id = { styles . endPointGuide } > { script . endPointGuide [ step ] } { '\n' } </ div > )
152+ }
153+ // return accordion element
154+ return (
155+ < Accordion hidden = { false } >
156+ < AccordionSummary
157+ expandIcon = { < ExpandMoreIcon /> }
158+ aria-controls = "panel1a-content"
159+ id = "panel1a-header"
160+ id = { styles . accordionSummary }
161+ >
162+ Endpoint Testing Configuration Guide
163+ </ AccordionSummary >
164+ < AccordionDetails id = { styles . configGuide } >
165+ { array }
166+ </ AccordionDetails >
167+ </ Accordion >
168+ ) ;
169+ }
170+
171+ // return anything to not render accordion
172+ return true ;
173+ } ;
174+
145175 return (
146176 < ReactModal
147177 className = { styles . modal2 }
@@ -161,7 +191,7 @@ const Modal = ({
161191 overlay : {
162192 left : isFileDirectoryOpen ? '276px' : '46px' ,
163193 minWidth : isFileDirectoryOpen ? '600px' : '600px' ,
164- width : isFileDirectoryOpen ? 'calc(59.9% - 276px)' : 'calc(49.9% - 46px)' ,
194+ width : isFileDirectoryOpen ? 'calc(59.9% - 276px)' : 'calc(49.9% - 46px)' ,
165195 } ,
166196 } }
167197 >
@@ -179,6 +209,7 @@ const Modal = ({
179209 { /* Accordian View */ }
180210 < div >
181211 { /* Configuration Guide */ }
212+ < EndPointGuide />
182213 < Accordion >
183214 < AccordionSummary
184215 expandIcon = { < ExpandMoreIcon /> }
@@ -282,7 +313,7 @@ const Modal = ({
282313 { /* To do: make button toggle on/off */ }
283314 < pre >
284315 < div className = "code-wrapper" >
285- < code >
316+ < code >
286317 { `jest ${ fileName } \n` }
287318 { `jest --verbose ${ fileName } \n` }
288319 { `jest --coverage ${ fileName } \n` }
0 commit comments