diff --git a/addon/components/pix-tooltip.hbs b/addon/components/pix-tooltip.hbs
index 82c9c05ad..e28c4bf06 100644
--- a/addon/components/pix-tooltip.hbs
+++ b/addon/components/pix-tooltip.hbs
@@ -1,5 +1,5 @@
+
## Is Light
diff --git a/app/stories/pix-tooltip.stories.js b/app/stories/pix-tooltip.stories.js
index 7c3b3ec97..7f3139b42 100644
--- a/app/stories/pix-tooltip.stories.js
+++ b/app/stories/pix-tooltip.stories.js
@@ -118,6 +118,23 @@ const TemplateWithIconElement = (args) => {
};
};
+const TemplateWithInputElement = (args) => {
+ return {
+ template: hbs`
+ <:triggerElement>
+
+ <:label>{{this.label}}
+
+
+
+ <:tooltip>
+ {{this.text}}
+
+`,
+ context: args,
+ };
+};
+
export const Default = Template.bind({});
Default.args = {
text: 'Hello World',
@@ -184,6 +201,12 @@ WithIcon.args = {
label: 'À survoler pour voir la tooltip',
};
+export const WithInput = TemplateWithInputElement.bind({});
+WithInput.args = {
+ text: 'Hello World',
+ label: 'À survoler pour voir la tooltip',
+};
+
export const hide = Template.bind({});
hide.args = {
label: "Survoler ici n'affiche pas tooltip",
diff --git a/tests/dummy/app/controllers/tooltip-page.js b/tests/dummy/app/controllers/tooltip-page.js
new file mode 100644
index 000000000..5da95329f
--- /dev/null
+++ b/tests/dummy/app/controllers/tooltip-page.js
@@ -0,0 +1,11 @@
+import Controller from '@ember/controller';
+import { tracked } from '@glimmer/tracking';
+import { action } from '@ember/object';
+
+export default class ModalPage extends Controller {
+ @tracked showModal = false;
+ title = "Qu'est-ce qu'une modale ?";
+
+ @action
+ onCloseButtonClick() {}
+}
diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js
index 063d9f1d6..a7be35f91 100644
--- a/tests/dummy/app/router.js
+++ b/tests/dummy/app/router.js
@@ -12,4 +12,5 @@ Router.map(function () {
this.route('modal-page', { path: '/modal' });
this.route('select-page', { path: '/select' });
this.route('sidebar-page', { path: '/sidebar' });
+ this.route('tooltip-page', { path: '/tooltip' });
});
diff --git a/tests/dummy/app/templates/tooltip-page.hbs b/tests/dummy/app/templates/tooltip-page.hbs
new file mode 100644
index 000000000..cc4ecb9c4
--- /dev/null
+++ b/tests/dummy/app/templates/tooltip-page.hbs
@@ -0,0 +1,29 @@
+{{! template-lint-disable no-inline-styles }}
+
+
+ <:triggerElement>
+
+ Label
+
+
+
+ <:tooltip>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut egestas molestie mauris vel
+ viverra.
+
+
+
+
+
+ <:triggerElement>
+
+ Label
+
+
+
+ <:tooltip>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut egestas molestie mauris vel
+ viverra.
+
+
+
\ No newline at end of file
diff --git a/tests/integration/components/pix-tooltip-test.js b/tests/integration/components/pix-tooltip-test.js
index eadd97ba7..37a4dd758 100644
--- a/tests/integration/components/pix-tooltip-test.js
+++ b/tests/integration/components/pix-tooltip-test.js
@@ -60,21 +60,20 @@ module('Integration | Component | pix-tooltip', function (hooks) {
test('it dismissed tooltip on escape keyup', async function (assert) {
// given
- const screen = await render(hbs`
+ const screen = await render(hbs`
<:triggerElement>
- template block text
+ Trigger
- <:tooltip>
+ <:tooltip>Some tooltip
`);
// when
- await screen.getByText('template block text').focus();
+ await screen.getByRole('button', { name: 'Trigger' }).focus();
await userEvent.keyboard('[Escape]');
// then
- assert.contains('template block text');
- assert.dom('.pix-tooltip__content').isNotVisible();
+ assert.dom('.pix-tooltip').doesNotHaveClass('pix-tooltip--visible');
});
module('tooltip position', function () {