Skip to content

Commit

Permalink
tech(certif): fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Libouk authored Jan 14, 2022
1 parent a5c01ef commit 773ec5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions certif/tests/acceptance/session-details_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,10 @@ module('Acceptance | Session Details', function (hooks) {
server.createList('certification-candidate', 4, { sessionId: session.id });

// when
await visit(`/sessions/${session.id}`);
const screen = await visit(`/sessions/${session.id}`);

// then
const candidateTabSelector = '.session-details-controls__navbar-tabs a:nth-of-type(2)';
const expectedTabContent = 'Candidats (4)';
const candidateTabElement = document.querySelector(candidateTabSelector);
assert.equal(candidateTabElement.innerHTML.trim(), expectedTabContent);
assert.dom(screen.getByRole('link', { name: 'Candidats (4)' })).exists();
});

module('when looking at the header', function () {
Expand Down
2 changes: 1 addition & 1 deletion certif/tests/helpers/contains.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getRootElement } from '@ember/test-helpers';

function getChildrenThatContainsText(element, text, isChild) {
if (element.textContent.trim().includes(text)) {
if (element.innerText?.includes(text)) {
return isChild ? element : [element];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ module('Integration | Component | SessionSupervising::CandidateInList', function

// then
sinon.assert.calledOnce(this.endAssessmentForCandidate);
assert.contains('Succès ! Le test de Yondu Undonta est terminé.');
assert.contains('Succès ! Le test de Yondu Undonta est terminé.');
});
});

Expand Down

0 comments on commit 773ec5d

Please sign in to comment.