-
Notifications
You must be signed in to change notification settings - Fork 141
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
Disable tethering while tooltips are hidden #96
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import Ember from 'ember'; | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import { assertHide, assertShow } from '../../helpers/sync/assert-visibility'; | ||
import { assertHide, assertShow, assertTetherEnabled, assertTetherDisabled } from '../../helpers/sync/assert-visibility'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would recommend against creating a new assertion just for the tether. This means that people will always have to opt in to the coverage and will likely skip that test. Instead I would add the check as part of assertShow and assertHide. When I did this I found some holes in my enable/disable coverage https://github.com/zenefits/ember-tooltips/pull/21/files#diff-c2e9fd979e3b24030663b2c4c84cd5beR3 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be blocking There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, good point. I'll try split it (or make a new PR if you want to merge already). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you could do it as part of this PR that'd be great. Thanks! |
||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
const { run } = Ember; | ||
|
@@ -11,38 +11,42 @@ moduleForComponent('tooltip-on-element', 'Integration | Option | isShown', { | |
|
||
test('It toggles with isShown', function(assert) { | ||
|
||
assert.expect(2); | ||
assert.expect(4); | ||
|
||
this.set('showTooltip', true); | ||
|
||
this.render(hbs`{{tooltip-on-element isShown=showTooltip}}`); | ||
|
||
assertShow(assert, this); | ||
assertTetherEnabled(assert, this); | ||
|
||
run(() => { | ||
this.set('showTooltip', false); | ||
}); | ||
|
||
assertHide(assert, this); | ||
assertTetherDisabled(assert, this); | ||
|
||
}); | ||
|
||
test('It toggles with tooltipIsVisible', function(assert) { | ||
// tooltipIsVisible is deprecated in favor of isShown | ||
// tooltipIsVisible will be supported until v3.0.0 | ||
|
||
assert.expect(2); | ||
assert.expect(4); | ||
|
||
this.set('showTooltip', true); | ||
|
||
this.render(hbs`{{tooltip-on-element tooltipIsVisible=showTooltip}}`); | ||
|
||
assertShow(assert, this); | ||
assertTetherEnabled(assert, this); | ||
|
||
run(() => { | ||
this.set('showTooltip', false); | ||
}); | ||
|
||
assertHide(assert, this); | ||
assertTetherDisabled(assert, this); | ||
|
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good note