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 May 23, 2024
1 parent 6bb9970 commit 1a6ffd6
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
16 changes: 6 additions & 10 deletions dashboard-prime/src/components/users/UsersTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,11 @@ const pageChanged = (pagingInfo) => {
loadData()
}
// const sortField = (column) => {
// sortBy.value = column.sortField
// ascending.value = column.sortOrder === 1
//
// // set to the first page
// currentPage.value = 1
// loadData()
// }
const sortField = () => {
// set to the first page
currentPage.value = 1
loadData()
}
</script>

<template>
Expand Down Expand Up @@ -187,7 +183,7 @@ const pageChanged = (pagingInfo) => {
:rowsPerPageOptions="possiblePageSizes"
v-model:sort-field="sortInfo.sortBy"
v-model:sort-order="sortInfo.sortOrder"
@sort="loadData"
@sort="sortField"
>
<Column field="userId" header="User" :sortable="true" :class="{'flex': responsive.md.value }">
<template #header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const nextButtonClicked = () => {
)
}
const isLoading = computed(() => loadingSkill.value)
const isLoading = computed(() => loadingSkill.value || skillState.loadingSkillSummary)
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, onMounted, computed } from 'vue'
import { ref, onMounted, computed, watch } from 'vue'
import { useRoute } from 'vue-router'
import { Network } from 'vis-network'
import { useSkillsDisplayAttributesState } from '@/skills-display/stores/UseSkillsDisplayAttributesState.js'
Expand Down Expand Up @@ -54,13 +54,21 @@ const displayOptions = {
}
onMounted(() => {
loadAllDataForPrereq()
})
watch( () => route.params.skillId, () => {
loadAllDataForPrereq()
});
const loadAllDataForPrereq = () => {
loadData().then(() => {
if (dependenciesInternal.value?.length > 0) {
initInternalDeps()
createGraph()
}
})
})
}
const isDependency = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const useSkillsDisplaySubjectState = defineStore('skillDisplaySubjectStat
subjectSummary,
loadSkillSummary,
skillSummary,
loadingSkillSummary,
addPoints,
nullifyExpirationDate,
updateDescription,
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/cypress/e2e/inception/inception_breadcrumb_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ describe('My Progress Breadcrumb Tests', () => {
});

it('test breadcrumbs starting on Rank page', function () {
cy.visit('/administrator/skills/inception/rank');
cy.visit('/administrator/skills/Inception/rank');

cy.get('[data-cy="levelBreakdownChart-animationEnded"]')
cy.get('[data-cy="title"]').contains('My Rank');
cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Projects"]')
cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard Skills"]')
cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"]').should('have.length', 2)
cy.get('[data-pc-name="breadcrumb"] [data-cy="breadcrumb-Rank"]')


cy.get('[data-pc-name="breadcrumb"] [data-pc-section="action"] [data-cy="breadcrumb-Dashboard Skills"]').click()
cy.get('[data-cy="title"]').contains('Dashboard Skills');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ describe('Client Display Prerequisites Snapshot Tests', () => {
.contains('Very Great Skill 3');
cy.get('[data-cy="depsProgress"] [data-cy="numDeps"]').should('have.text', '2')
cy.wait(4000);
cy.matchSnapshotImageForElement('[data-cy="skillsDisplayHome"]', `InProjectDependency-parent`);
cy.matchSnapshotImageForElement('[data-cy="skillsDisplayHome"] [data-cy="prerequisitesCard"]', `InProjectDependency-parent`);

// Go to child dependency page
cy.clickOnNode(600, 262);
Expand All @@ -278,7 +278,7 @@ describe('Client Display Prerequisites Snapshot Tests', () => {
// should render Prerequisites section
cy.get('[data-cy="depsProgress"] [data-cy="numDeps"]').should('have.text', '1')
cy.wait(4000);
cy.matchSnapshotImageForElement('[data-cy="skillsDisplayHome"]', `InProjectDependency-child`);
cy.matchSnapshotImageForElement('[data-cy="skillsDisplayHome"] [data-cy="prerequisitesCard"]', `InProjectDependency-child`);
});

it('cross-project skill dep is shown when skill ids match', function () {
Expand Down
3 changes: 1 addition & 2 deletions e2e-tests/cypress/e2e/users_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ describe('Users Tests', () => {
}
}

cy.visit('/administrator/projects/proj1/');
cy.clickNav('Users');
cy.visit('/administrator/projects/proj1/users');

// default sort order is 'Points Last Earned' desc
cy.validateTable(tableSelector, [
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1a6ffd6

Please sign in to comment.