Skip to content

Commit

Permalink
feat(junior): add tooltip to classes selection
Browse files Browse the repository at this point in the history
  • Loading branch information
rouxxi committed Sep 20, 2024
1 parent 8541cbd commit 61db03c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
16 changes: 14 additions & 2 deletions junior/app/templates/school/divisions.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@
</RobotDialog>
<div class="list">
{{#each @model.divisions as |division|}}
<LinkTo @route="school.students" @query={{hash division=division}} class="divisions__item">
<p class="item__title">{{division}}</p>
<LinkTo @route="school.students" @query={{hash division=division}}>
<PixTooltip @isInline={{true}}>
<:triggerElement>
<div class="divisions__item">
<p class="item__title">{{division}}</p>

</div>
</:triggerElement>

<:tooltip>
{{division}}
</:tooltip>
</PixTooltip>
</LinkTo>

{{/each}}
</div>
<Footer />
33 changes: 33 additions & 0 deletions junior/tests/acceptance/school-divisions-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { visit } from '@1024pix/ember-testing-library';
import { module, test } from 'qunit';

import { setupApplicationTest } from '../../tests/helpers';

module('Acceptance | School | divisions', function (hooks) {
setupApplicationTest(hooks);
hooks.afterEach(async function () {
localStorage.clear();
});

test('should display all existant divisions', async function (assert) {
// given
const longClassName = 'CM2-B 3 3 3 3 adzaz azd adazdzad dzad d';
this.server.create('school', {
organizationLearners: [
{
id: 1,
division: longClassName,
firstName: 'Sara',
displayName: 'Sara A.',
organizationId: 9000,
},
{ id: 2, division: 'CM2 A', firstName: 'Mickey', displayName: 'Mickey', organizationId: 9000 },
],
});
// when
const screen = await visit('/schools/MINIPIXOU');
const htmlElementsWithLongName = screen.queryAllByText(longClassName);

assert.strictEqual(htmlElementsWithLongName.length, 2);
});
});

0 comments on commit 61db03c

Please sign in to comment.