Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exquisite Corpse #8

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add select option for word type
  • Loading branch information
LemonyDesign committed Oct 12, 2018
commit b2cba5ad059b1c0a294ba5e80a4874a0556daed4
6 changes: 3 additions & 3 deletions src/components/Generate.js
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ function Generate({receiveType, typeresult1, typeresult2, favourites, addFavouri
<h2>The Generator</h2>

<section className="generate">
<ul className="generate__adjectives menu--settings" >
<ul className="generate__type1 menu--settings" >
<li><select className="generator select1" onChange={handleChange1}>
<option default value="default">Select</option>
<option value="adjective">Adjective</option>
@@ -28,11 +28,11 @@ function Generate({receiveType, typeresult1, typeresult2, favourites, addFavouri
{typeresult1.map(type1 => {
return <Word
key={type1}
type1={type1}
type1={type1}
/>
})}
</ul>
<ul className="generate__nouns menu--settings" >
<ul className="generate__type2 menu--settings" >
<li><select className="generator select2" onChange={handleChange2}>
<option default value="default">Select</option>
<option value="noun">Noun</option>
3 changes: 3 additions & 0 deletions src/styles/components/generate.scss
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@
opacity: 1;
}
.generate {
ul, .generator {
width: 50%;
}
button {
display: inline-block;
width: 100%;
11 changes: 9 additions & 2 deletions tests/components/Generate.test.js
Original file line number Diff line number Diff line change
@@ -6,8 +6,15 @@ describe('Generate', () => {

// enzyme test
test('should have inital select value on generate adjectives', () => {
const wrapper = shallow(<Generate />)
const select1 = wrapper.find('.select1 option')

const wrapper = shallow(
<Generate
typeresult1 = {[]}
/>)

const select1 = wrapper.find('.select1 option').selected
expect(select1).toBe('default')
})

test('select noun')
});
26 changes: 9 additions & 17 deletions tests/components/__snapshots__/App.test.js.snap
Original file line number Diff line number Diff line change
@@ -81,25 +81,21 @@ exports[`App matches the snapshot 1`] = `
onChange={[Function]}
>
<option
value="adjective"
default={true}
value="default"
>
Adjective
Select
</option>
<option
value="noun"
value="adjective"
>
Noun
Adjective
</option>
<option
value="adverb"
>
Adverb
</option>
<option
value="verb"
>
Verb
</option>
</select>
</li>
</ul>
@@ -108,24 +104,20 @@ exports[`App matches the snapshot 1`] = `
>
<li>
<select
className="generator"
className="generator select2"
onChange={[Function]}
>
<option
value="adjective"
default={true}
value="default"
>
Adjective
Select
</option>
<option
value="noun"
>
Noun
</option>
<option
value="adverb"
>
Adverb
</option>
<option
value="verb"
>