Skip to content

Commit e0c41ed

Browse files
committed
created tests for redux, react, and endpoints. Updated placeholder text for render hooks and reducer
2 parents 72c42b3 + 3eb689d commit e0c41ed

File tree

22 files changed

+452
-368
lines changed

22 files changed

+452
-368
lines changed

src/containers/LeftPanel/Action/Action.jsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@ const Action = ({ action, index, dispatchToTestCase }) => {
3737
return eventsWithValues.includes(eventType);
3838
};
3939

40-
// const dropDownMockOptions = [];
41-
// mockData.forEach(mockDatum => {
42-
// mockDatum.fieldKeys.forEach(key => {
43-
// dropDownMockOptions.push(`mock${mockDatum.name}.${key.fieldKey}`);
44-
// });
45-
// dropDownMockOptions.push(`[mock${mockDatum.name}]`);
46-
// dropDownMockOptions.push(`{mock${mockDatum.name}}`);
47-
// });
48-
49-
// let options = dropDownMockOptions.map(option => {
50-
// return (
51-
// <option id='eventValue' value={option}>
52-
// {option}
53-
// </option>
54-
// );
55-
// });
5640
return (
5741
<Draggable draggableId={action.id.toString()} index={index}>
5842
{provided => (

src/containers/LeftPanel/ActionCreator/ActionCreator.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,24 @@ const ActionCreator = ({ actionCreator, index, dispatchToReduxTestCase }) => {
5858

5959
<div id={styles.filesFlexBox}>
6060
<div id={styles.files}>
61-
<label htmlFor='actionsFolder'>Actions File</label>
61+
<label htmlFor='actionsFolder'>Import Actions From</label>
6262
<input
6363
type='text'
6464
id='actionsFolder'
6565
value={actionCreator.actionsFile}
6666
onChange={handleChangeActionsFileName}
67+
placeholder='File Name'
6768
/>
6869
</div>
6970

7071
<div id={styles.files}>
71-
<label htmlFor='typesFolder'>Action Types File</label>
72+
<label htmlFor='typesFolder'>Import Action Types From</label>
7273
<input
7374
type='text'
7475
id='typesFolder'
7576
value={actionCreator.typesFile}
7677
onChange={handleChangeTypesFileName}
78+
placeholder='File Name'
7779
/>
7880
</div>
7981
</div>
@@ -85,6 +87,7 @@ const ActionCreator = ({ actionCreator, index, dispatchToReduxTestCase }) => {
8587
type='text'
8688
id='actionCreatorFunc'
8789
onChange={e => handleChangeActionCreatorFields(e, 'actionCreatorFunc')}
90+
placeholder='e.g. addTodo'
8891
/>
8992
</div>
9093

@@ -94,6 +97,7 @@ const ActionCreator = ({ actionCreator, index, dispatchToReduxTestCase }) => {
9497
type='text'
9598
id='actionType'
9699
onChange={e => handleChangeActionCreatorFields(e, 'actionType')}
100+
placeholder='e.g. ADD_TODO'
97101
/>
98102
</div>
99103
</div>
@@ -105,6 +109,7 @@ const ActionCreator = ({ actionCreator, index, dispatchToReduxTestCase }) => {
105109
type='text'
106110
id='payloadKey'
107111
onChange={e => handleChangeActionCreatorFields(e, 'payloadKey')}
112+
placeholder='e.g. todo'
108113
/>
109114
</div>
110115

src/containers/LeftPanel/Context/Context.jsx

Lines changed: 96 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -48,129 +48,119 @@ const Context = ({ context, index, dispatchToHooksTestCase }) => {
4848
</div>
4949

5050
<div>
51-
<div id={styles.queryFlexBox}>
5251
<div id={styles.querySelector}>
53-
<label htmlFor='queryVariant' className={styles.queryLabel}>
54-
Query Selector
55-
</label>
52+
<div id={styles.contextBox}>
53+
<label htmlFor='contextFile'>Import Context From</label>
54+
<input
55+
type='text'
56+
id='contextFile'
57+
placeholder='File Name'
58+
value={context.contextFile}
59+
onChange={handleChangeContextFileName}
60+
/>
61+
</div>
62+
5663
<div id={styles.dropdownFlex}>
5764
{/* drop downs */}
58-
<select
59-
id='queryValue'
60-
onChange={e => handleChangeContextFields(e, 'queryValue')}
61-
>
62-
<option value='' />
63-
<option value='shows_default_value'>shows_default_value</option>
64-
<option value='shows_value_from_provider'>shows_value_from_provider</option>
65-
<option value='component_provides_context_value'>
66-
component_provides_context_value
67-
</option>
68-
<option value='renders_providers_+_consumers_normally'>
69-
renders_providers_+_consumers_normally
70-
</option>
71-
</select>
72-
<span id={styles.hastooltip} role='tooltip'>
73-
<img src={questionIcon} alt='help' />
74-
<span id={styles.tooltip}>
75-
<ToolTip toolTipType={context.queryVariant} />
76-
</span>
77-
</span>
78-
79-
<select
80-
id='queryVariant'
81-
onChange={e => handleChangeContextFields(e, 'queryVariant')}
82-
>
83-
<option value='' />
84-
<option value='toHaveTextContext'>toHaveTextContext</option>
85-
<option value='toBeInTheDocument'>toBeInTheDocument</option>
86-
<option value='toBe'>toBe</option>
87-
</select>
88-
<span id={styles.hastooltip} role='tooltip'>
89-
<img src={questionIcon} alt='help' />
90-
<span id={styles.tooltip}>
91-
<ToolTip toolTipType={context.queryVariant} />
92-
</span>
93-
</span>
94-
95-
<select
96-
id='querySelector'
97-
onChange={e => handleChangeContextFields(e, 'querySelector')}
98-
>
99-
<option value='' />
100-
<option value='getByText'>getByText</option>
101-
</select>
102-
<span id={styles.hastooltip} role='tooltip'>
103-
<img src={questionIcon} alt='help' />
104-
<span id={styles.tooltip}>
105-
<ToolTip toolTipType={context.queryVariant} />
106-
</span>
107-
</span>
65+
<div id={styles.contextDrop}>
66+
<label htmlFor='queryVariant' className={styles.queryLabel}>
67+
Test Type
68+
</label>
69+
<select
70+
id='queryValue'
71+
onChange={e => handleChangeContextFields(e, 'queryValue')}
72+
>
73+
<option value='' />
74+
<option value='shows_default_value'>shows_default_value</option>
75+
<option value='shows_value_from_provider'>shows_value_from_provider</option>
76+
<option value='component_provides_context_value'>
77+
component_provides_context_value
78+
</option>
79+
<option value='renders_providers_+_consumers_normally'>
80+
renders_providers_+_consumers_normally
81+
</option>
82+
</select>
83+
</div>
84+
85+
<div id={styles.contextDrop}>
86+
<label htmlFor='queryVariant' className={styles.queryLabel}>
87+
Query Variant
88+
</label>
89+
<select
90+
id='queryVariant'
91+
onChange={e => handleChangeContextFields(e, 'queryVariant')}
92+
>
93+
<option value='' />
94+
<option value='toHaveTextContext'>toHaveTextContext</option>
95+
<option value='toBeInTheDocument'>toBeInTheDocument</option>
96+
<option value='toBe'>toBe</option>
97+
</select>
98+
</div>
99+
100+
<div id={styles.contextDrop}>
101+
<label htmlFor='queryVariant' className={styles.queryLabel}>
102+
Query Selector
103+
</label>
104+
<select
105+
id='querySelector'
106+
onChange={e => handleChangeContextFields(e, 'querySelector')}
107+
>
108+
<option value='' />
109+
<option value='getByText'>getByText</option>
110+
</select>
111+
</div>
108112
</div>
113+
109114
<div id={styles.queryFlexBox}>
110115
{/* input boxes */}
111-
<input
112-
id='consumerComponent'
113-
onChange={e => handleChangeContextFields(e, 'consumerComponent')}
114-
></input>
115-
<span id={styles.hastooltip} role='tooltip'>
116-
<img src={questionIcon} alt='help' />
117-
<span id={styles.tooltip}>
118-
<ToolTip toolTipType={context.querySelector} />
119-
</span>
120-
</span>
116+
<div id={styles.contextBox}>
117+
<label htmlFor='queryVariant' className={styles.queryLabel}>
118+
Consumer Component
119+
</label>
120+
<input
121+
id='consumerComponent'
122+
placeholder='eg. nameOfConsumer'
123+
onChange={e => handleChangeContextFields(e, 'consumerComponent')}
124+
></input>
125+
</div>
121126

122-
<input
123-
id='providerComponent'
124-
onChange={e => handleChangeContextFields(e, 'providerComponent')}
125-
></input>
126-
<span id={styles.hastooltip} role='tooltip'>
127-
<img src={questionIcon} alt='help' />
128-
<span id={styles.tooltip}>
129-
<ToolTip toolTipType={context.querySelector} />
130-
</span>
131-
</span>
127+
<div id={styles.contextBox}>
128+
<label htmlFor='queryVariant' className={styles.queryLabel}>
129+
Provider Component
130+
</label>
131+
<input
132+
id='providerComponent'
133+
placeholder='eg. nameOfProvider'
134+
onChange={e => handleChangeContextFields(e, 'providerComponent')}
135+
></input>
136+
</div>
132137
</div>
138+
133139
<div id={styles.queryFlexBox}>
140+
<div id={styles.contextBox}>
141+
<label htmlFor='queryVariant' className={styles.queryLabel}>
142+
Context
143+
</label>
134144
<input
135145
id='context'
146+
placeholder='eg. nameOfContext'
136147
onChange={e => handleChangeContextFields(e, 'context')}
137148
></input>
138-
<span id={styles.hastooltip} role='tooltip'>
139-
<img src={questionIcon} alt='help' />
140-
<span id={styles.tooltip}>
141-
<ToolTip toolTipType={context.querySelector} />
142-
</span>
143-
</span>
144-
145-
<input id='values' onChange={e => handleChangeContextFields(e, 'values')}></input>
146-
<span id={styles.hastooltip} role='tooltip'>
147-
<img src={questionIcon} alt='help' />
148-
<span id={styles.tooltip}>
149-
<ToolTip toolTipType={context.querySelector} />
150-
</span>
151-
</span>
149+
</div>
152150

153-
<input
154-
id='textNode'
155-
onChange={e => handleChangeContextFields(e, 'textNode')}
156-
></input>
157-
<span id={styles.hastooltip} role='tooltip'>
158-
<img src={questionIcon} alt='help' />
159-
<span id={styles.tooltip}>
160-
<ToolTip toolTipType={context.querySelector} />
161-
</span>
162-
</span>
163-
<label htmlFor='contextFile'>Context File</label>
164-
<input
165-
type='text'
166-
id='contextFile'
167-
value={context.contextFile}
168-
onChange={handleChangeContextFileName}
169-
/>
151+
<div id={styles.contextBox}>
152+
<label htmlFor='queryVariant' className={styles.queryLabel}>
153+
Value To Pass
154+
</label>
155+
<input
156+
id='values'
157+
placeholder='eg. theValueToPassWithContext'
158+
onChange={e => handleChangeContextFields(e, 'values')}></input>
159+
</div>
170160
</div>
171161
</div>
162+
172163
</div>
173-
</div>
174164
</div>
175165
)}
176166
</Draggable>

src/containers/LeftPanel/Context/Context.module.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,32 @@
105105

106106
box-shadow: 0 0.05em 0.15em rgba(black, 0.1);
107107
@include tooltip;
108+
}
109+
110+
#contextBox {
111+
width: 50%;
112+
margin-right: 7%;
113+
input {
114+
margin-top: 6px;
115+
width: 100%;
116+
margin-bottom: 7%
117+
118+
}
119+
}
120+
121+
#contextDrop {
122+
margin-right: 7%;
123+
width: 50%;
124+
select {
125+
margin-top: 0px;
126+
font-family: $raleway;
127+
width: 100%;
128+
height: 25px;
129+
background-color: white;
130+
border: 1px solid $light-gray;
131+
font-size: 12px;
132+
letter-spacing: 0.5px;
133+
color: $dark-gray;
134+
margin-bottom: 11%
135+
}
108136
}

src/containers/LeftPanel/Endpoint/Endpoint.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ const Endpoint = ({ endpoint, index, dispatchToEndpointTestCase }) => {
4848

4949
<div id={styles.filesFlexBox}>
5050
<div id={styles.files}>
51-
<label htmlFor='endpointFile'>Server File Name</label>
51+
<label htmlFor='endpointFile'>Import Server From</label>
5252
<div id={styles.payloadFlexBox}>
5353
<input
5454
type='text'
55+
placeholder='File Name'
5556
id={styles.renderInputBox}
5657
value={endpoint.serverFile}
5758
onChange={handleChangeServerFileName}
@@ -103,7 +104,7 @@ const Endpoint = ({ endpoint, index, dispatchToEndpointTestCase }) => {
103104
<input
104105
type='text'
105106
name='expectedResponse'
106-
placeholder="body.yourKey or status"
107+
placeholder="body.key or status"
107108
onChange={e => handleChangeEndpointFields(e, 'expectedResponse')} />
108109
</div>
109110
</div>

0 commit comments

Comments
 (0)