Skip to content

Commit

Permalink
rename ecb prefix to ece and add div around buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
pogopaule committed Mar 23, 2015
1 parent 49d413c commit b711405
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
8 changes: 6 additions & 2 deletions addon/templates/components/confirm-extension.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<span {{action 'click'}}>{{yield}}</span>
{{#if confirmMode}}
<div class="ecb-bubble">
<span class="ecb-question">{{questionText}}</span><span class="ecb-confirm" {{action 'confirm'}}>{{confirmText}}</span><span class="ecb-decline" {{action 'decline'}}>{{declineText}}</span>
<div class="ece-bubble">
<div class="ece-question">{{questionText}}</div>
<div class="ece-buttons">
<span class="ece-confirm" {{action 'confirm'}}>{{confirmText}}</span>
<span class="ece-decline" {{action 'decline'}}>{{declineText}}</span>
</div>
</div>
{{/if}}
20 changes: 10 additions & 10 deletions tests/unit/components/confirm-extension-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ test('click on yielded template shows a bubble with a confrim and a decline opti
});

var $component = this.render();
assert.equal($component.find('.ecb-bubble').length, 0);
assert.equal($component.find('.ece-bubble').length, 0);
$component.find('span').click();
assert.equal($component.find('.ecb-confirm').text().trim(), 'yes');
assert.equal($component.find('.ecb-decline').text().trim(), 'no');
assert.equal($component.find('.ecb-bubble').length, 1);
assert.equal($component.find('.ece-confirm').text().trim(), 'yes');
assert.equal($component.find('.ece-decline').text().trim(), 'no');
assert.equal($component.find('.ece-bubble').length, 1);
});

test('click on decline leaves the confirm mode and hides the bubble', function(assert) {
Expand All @@ -32,10 +32,10 @@ test('click on decline leaves the confirm mode and hides the bubble', function(a
});

var $component = this.render();
assert.equal($component.find('.ecb-bubble').length, 1);
$component.find('.ecb-decline').click();
assert.equal($component.find('.ece-bubble').length, 1);
$component.find('.ece-decline').click();
assert.equal(component.get('confirmMode'), false);
assert.equal($component.find('.ecb-bubble').length, 0);
assert.equal($component.find('.ece-bubble').length, 0);
});

test('click on confirm triggers the confirmAction, leaves confirmMode and hides bubble', function(assert) {
Expand All @@ -53,8 +53,8 @@ test('click on confirm triggers the confirmAction, leaves confirmMode and hides
});

var $component = this.render();
assert.equal($component.find('.ecb-bubble').length, 1);
$component.find('.ecb-confirm').click();
assert.equal($component.find('.ece-bubble').length, 1);
$component.find('.ece-confirm').click();
assert.equal(component.get('confirmMode'), false);
assert.equal($component.find('.ecb-bubble').length, 0);
assert.equal($component.find('.ece-bubble').length, 0);
});

0 comments on commit b711405

Please sign in to comment.