`);
}
@@ -74,34 +74,34 @@ module('Integration | Component | modifiers/enable-tooltip', function (hooks) {
});
test('When content has no overflow, it does not display tooltip on hover', async function (assert) {
await render(hbs`
-
- abc
-
- `);
+
+ abc
+
+ `);
await assert.tooltip('.test-container').doesNotExist();
});
test('When content has overflow, it displays tooltip on hover', async function (assert) {
await render(hbs`
-
- abcdefghijklmnopqrstuvwxyz
-
- `);
+
+ abcdefghijklmnopqrstuvwxyz
+
+ `);
await assert.tooltip('.test-container').exists();
});
@@ -145,4 +145,76 @@ module('Integration | Component | modifiers/enable-tooltip', function (hooks) {
await assert.tooltip('.test-container').isNotHtmlSafe();
});
});
+
+ module('works on disabled elements', () => {
+ async function renderDisabledButton() {
+ await render(hbs`
+
+ `);
+ }
+
+ test('it renders the tooltip on disabled button and using the custom assertion can verify its existence', async function (assert) {
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').exists();
+ });
+
+ test('it renders the tooltip on disabled button and using the custom assertion can verify its title', async function (assert) {
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').hasTitle(this.title);
+ });
+
+ test('it renders the tooltip on disabled button and using the custom assertion can verify its subtitle', async function (assert) {
+ this.subtitle = 'subtitle';
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').hasSubtitle(this.subtitle);
+ });
+
+ test('it renders the tooltip on disabled button and using the custom assertion can verify its icon', async function (assert) {
+ this.icon = 'far fa-wine-glass-alt';
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').hasIcon(this.icon);
+ });
+
+ test('it renders the tooltip on disabled button and using the custom assertion can verify its placement', async function (assert) {
+ this.placement = 'top';
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').hasPlacement(this.placement);
+ });
+
+ test("it renders the tooltip on disabled button and using the custom assertion can verify it doesn't have an icon", async function (assert) {
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').doesNotHaveIcon();
+ });
+
+ test("it renders the tooltip on disabled button and using the custom assertion can verify it doesn't have a subtitle", async function (assert) {
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').doesNotHaveSubtitle();
+ });
+
+ module('html attribute', () => {
+ test('it renders the tooltip on disabled button and using the custom assertion can verify its html safe mode', async function (assert) {
+ this.html = true;
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').isHtmlSafe();
+ });
+
+ test('it renders the tooltip on disabled button and using the custom assertion can verify it is not in html safe mode', async function (assert) {
+ this.html = false;
+ await renderDisabledButton();
+
+ await assert.tooltip('.test-button').isNotHtmlSafe();
+ });
+ });
+ });
});