Skip to content

Commit

Permalink
#2490: fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-may committed Jul 10, 2024
1 parent c0fea7f commit 0339786
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ const skillId = computed(() => {
</Tag>
</div>
</div>
<div class="text-right align-content-end flex flex-column"
<div class="text-right justify-content-end flex flex-column"
:class="{ 'text-green-800' : isSkillComplete }"
data-cy="skillProgress-ptsOverProgressBard">
<i class="fa fa-check mr-1 pb-1 align-content-end"
v-if="isSkillComplete"
:data-cy="`skillCompletedCheck-${skillId}`"
aria-hidden="true" />
<span v-if="skill.isSkillsGroupType" class="align-content-end">
<span v-if="skill.isSkillsGroupType" class="justify-content-end">
<animated-number :num="numChildSkillsComplete" />
/ {{ numFormat.pretty(numSkillsRequired) }} Skill{{ (numSkillsRequired === 1) ? '' : 's' }}
{{ someSkillsAreOptional ? 'Required' : '' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,47 @@ describe('Client Display Features Tests', () => {
cy.get('[data-cy="newSoftwareVersion"]').should('not.exist')
})

it('skills-client - display new version banner when software is updated', () => {
cy.ignoreSkillsClientError()
cy.createSubject(1, 1);
cy.intercept('/api/projects/proj1/subjects/subj1/rank').as('getSubjRank')
cy.intercept({ url: '/api/projects/proj1/subjects/subj1/summary*', times: 1 }, (req) => {
req.reply((res) => {
res.send(200, {
'subject': 'Subject 1',
'subjectId': 'subj1',
'description': 'Description',
'skillsLevel': 0,
'totalLevels': 5,
'points': 0,
'totalPoints': 0,
'todaysPoints': 0,
'levelPoints': 0,
'levelTotalPoints': 0,
'skills': [],
'iconClass': 'fa fa-question-circle',
'helpUrl': 'http://doHelpOnThisSubject.com'
}, { 'skills-client-lib-version': dateFormatter(new Date()) })
})
})
.as('getSubjectSummary')
cy.intercept('GET', '/api/projects/proj1/pointHistory')
.as('pointHistoryChart')

cy.visit('/test-skills-client/proj1/?enableTheme=true')
cy.wrapIframe().find('[data-cy="skillTreePoweredBy"]')
cy.wrapIframe().find('[data-cy="pointHistoryChartNoData"]')
cy.wrapIframe().find('[data-cy="myRankPosition"]')
cy.wrapIframe().find('[data-cy="subjectTileBtn"]')

cy.wrapIframe().find('[data-cy="subjectTileBtn"]').click()
cy.wrapIframe().find('[data-cy="skillTreePoweredBy"]')
cy.wrapIframe().find('[data-cy="pointHistoryChartNoData"]')
cy.wrapIframe().find('[data-cy="myRankPosition"]')

cy.wrapIframe().find('[data-cy="newSoftwareVersion"]').contains('New SkillTree Software Version')
})

it('skills-client: display new version banner when software is updated', () => {
cy.intercept('/api/projects/proj1/summary').as('proj1Summary')
cy.intercept('/api/projects/proj1/subjects/subj1/summary*', (req) => {
Expand Down
45 changes: 0 additions & 45 deletions e2e-tests/cypress/e2e/client-display/client-display-theme_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,49 +796,4 @@ describe('Client Display Tests', () => {
cy.matchSnapshotImageForElement('[data-cy="selfReportMsgInput"]');
})

it('in theme -display new version banner when software is updated', () => {
cy.ignoreSkillsClientError()
cy.createSubject(1, 1);
cy.intercept('/api/projects/proj1/subjects/subj1/rank').as('getSubjRank')
cy.intercept({ url: '/api/projects/proj1/subjects/subj1/summary*', times: 1 }, (req) => {
req.reply((res) => {
res.send(200, {
'subject': 'Subject 1',
'subjectId': 'subj1',
'description': 'Description',
'skillsLevel': 0,
'totalLevels': 5,
'points': 0,
'totalPoints': 0,
'todaysPoints': 0,
'levelPoints': 0,
'levelTotalPoints': 0,
'skills': [],
'iconClass': 'fa fa-question-circle',
'helpUrl': 'http://doHelpOnThisSubject.com'
}, { 'skills-client-lib-version': dateFormatter(new Date()) })
})
})
.as('getSubjectSummary')
cy.intercept('GET', '/api/projects/proj1/pointHistory')
.as('pointHistoryChart')

cy.visit('/test-skills-client/proj1/?enableTheme=true')
cy.wrapIframe().find('[data-cy="skillTreePoweredBy"]')
cy.wrapIframe().find('[data-cy="pointHistoryChartNoData"]')
cy.wrapIframe().find('[data-cy="myRankPosition"]')
cy.wrapIframe().find('[data-cy="subjectTileBtn"]')

cy.wrapIframe().find('[data-cy="subjectTileBtn"]').click()
cy.wrapIframe().find('[data-cy="skillTreePoweredBy"]')
cy.wrapIframe().find('[data-cy="pointHistoryChartNoData"]')
cy.wrapIframe().find('[data-cy="myRankPosition"]')

cy.wrapIframe().find('[data-cy="newSoftwareVersion"]').contains('New SkillTree Software Version')

cy.wait(4000)
cy.matchSnapshotImageForElement('body iframe', { errorThreshold: 0.05 })


})
});

0 comments on commit 0339786

Please sign in to comment.