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

Hiding the action button that correspond to the current state #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions __tests__/components/Pomodoro/Pomodoro-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ describe('<Pomodoro /> tests of default settings', () => {
assert.isFalse(component.node.refs.notification.checked);
});

it('should be two buttons to control the play and pause', () => {
it('should be one visible button to control the play and pause', () => {
let buttons = component.find('div.pomodoro div.controlsPlay button');

assert.equal(buttons.length, 2);
assert.equal(buttons.length, 1);

let playButton = buttons.find('.play').node,
stopButton = buttons.find('.stop').node;
let playButton = buttons.find('.play').node;

assert.isDefined(playButton);
assert.isDefined(stopButton);
});

it('should be three buttons to change pomodoro type', () => {
Expand Down
3 changes: 1 addition & 2 deletions app/components/Pomodoro/Pomodoro.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ export default class Pomodoro extends React.Component {

<div className="container">
<div className="controlsPlay">
<button className="play btnIcon" onClick={this.play}></button>
<button className="stop btnIcon" onClick={this.reset}></button>
{ (this.state.play) ? <button className="stop btnIcon" onClick={this.reset}></button> : <button className="play btnIcon" onClick={this.play}></button> }
</div>
</div>

Expand Down