Skip to content

Commit

Permalink
[qa] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frankrousseau committed Sep 18, 2024
1 parent b9802c4 commit 1c16b81
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/lists/AssetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
v-for="(group, k) in displayedAssets"
v-if="!isLoading && isListVisible"
>
<tr class="datatable-type-header">
<tr class="datatable-type-header" v-if="group[0]">
<th scope="rowgroup" :colspan="visibleColumns">
<span
class="datatable-row-header pointer"
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ const mutations = {
if (!isTime && asset.timeSpent > 0) isTime = true
if (!isEstimation && asset.estimation > 0) isEstimation = true
if (!isDescription && asset.description) isDescription = true
if (!isResolution && asset.data.resolution) isResolution = true
if (!isResolution && asset.data?.resolution) isResolution = true
})

const assetTypes = Array.from(assetTypeMap.values())
Expand Down
4 changes: 3 additions & 1 deletion src/store/modules/tasktypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const getters = {
sequenceSubscriptions: state => state.sequenceSubscriptions,

currentTaskType: (state, getters, rootState) => {
return state.taskTypeMap.get(rootState.route.params.task_type_id) || {}
const route = rootState.route || {}
const params = route.params || {}
return state.taskTypeMap.get(params.task_type_id) || {}
},

assetTaskTypes: (state, getters, rootState, rootGetters) => {
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/store/assets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,10 @@ describe('Assets store', () => {
expect(state).toEqual({
assetMap: new Map(),
assetValidationColumns: [],
displayedAssets: [],
assetFilledColumns: {},
assetSearchFilterGroups: [],
assetSearchQueries: [],
displayedAssets: [],
displayedAssetsCount: 0,
displayedAssetsLength: 0,
displayedAssetsTimeSpent: 0,
Expand Down Expand Up @@ -987,6 +987,7 @@ describe('Assets store', () => {
isAssetTime: false,
isAssetEstimation: false,
isAssetDescription: true,
isAssetResolution: false,
assetValidationColumns: [],
nbValidationColumns: 0,
displayedAssets: store.cache.assets,
Expand Down Expand Up @@ -2002,6 +2003,7 @@ describe('Assets store', () => {
isAssetDescription: false,
isAssetEstimation: false,
isAssetTime: false,
isAssetResolution: false,
isAssetsLoading: false,
isAssetsLoadingError: false,
nbValidationColumns: 0,
Expand Down

0 comments on commit 1c16b81

Please sign in to comment.