Skip to content

Commit a3347d7

Browse files
* Refactoring select of areas in screen create client
1 parent 0a9a808 commit a3347d7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

app/components/Client/Save/Client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ class Client extends React.Component
164164
name='area'
165165
value={ this.state.client.area }
166166
onChange={this.handleChange}
167+
required="true"
167168
>
169+
<option value="">Select One</option>
168170
{
169171
this.state.areas.map((area, key) => (
170172
<option value={ area._id } key={ key }>{ area._id}</option>

tests/Save.Client.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,14 @@ describe('Test Save Client', () => {
277277
);
278278

279279
setTimeout(() => {
280-
281-
expect(component.find('select option').at(0).text()).toEqual('Center');
282-
expect(component.find('select option').at(1).text()).toEqual('South');
283-
done();
280+
try {
281+
expect(component.find('select option').at(0).text()).toEqual('Select One');
282+
expect(component.find('select option').at(1).text()).toEqual('Center');
283+
expect(component.find('select option').at(2).text()).toEqual('South');
284+
done();
285+
} catch (e) {
286+
console.log(e);
287+
}
284288
}, 0);
285289
});
286290

0 commit comments

Comments
 (0)