Skip to content
Permalink
Browse files

Made start button navigate to /rounds/1

Co-authored-by: Selena Small <selenawiththetattoo@gmail.com>
Co-authored-by: Michael Milewski <saramic@gmail.com>
  • Loading branch information...
3 people committed Nov 24, 2018
1 parent af7cd60 commit 1a3f44d31def8160b6f7ff4a14a297055c037b36
Showing with 13 additions and 9 deletions.
  1. +1 −1 client/src/App.js
  2. +6 −5 client/src/App.test.js
  3. +5 −2 client/src/__snapshots__/App.test.js.snap
  4. +1 −1 spec/features/games_spec.rb
@@ -7,7 +7,7 @@ class App extends Component {
<div className="App">
<header className="App-header">
<h2>Welcome to the Game</h2>
<button>Start Game</button>
<a href="/rounds/1" data-start-button>Start Game</a>
</header>
</div>
);
@@ -17,8 +17,9 @@ it('renders welcome message', () => {
expect(shallowToJson(wrapper)).toMatchSnapshot();
});

it('renders a button', () => {
const wrapper = shallow(<App />);
const button = <button>Start Game</button>;
expect(wrapper.contains(button)).toEqual(true);
});
describe('button', () => {
it('takes you to round 1 on click', () => {
const wrapper = shallow(<App/>);
expect(wrapper.find('[data-start-button]').prop('href')).toEqual('/rounds/1')
});
})
@@ -10,9 +10,12 @@ exports[`renders welcome message 1`] = `
<h2>
Welcome to the Game
</h2>
<button>
<a
data-start-button={true}
href="/rounds/1"
>
Start Game
</button>
</a>
</header>
</div>
`;
@@ -5,7 +5,7 @@
visit '/'
expect(page).to have_content 'Welcome to the Game'

page.find('button').click
page.find('[data-start-button]').click
pending("Haven't written any rounds yet")
expect(page).to have_content 'This is round 1'
end

0 comments on commit 1a3f44d

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.