Skip to content

Commit

Permalink
Termine l'évaluation quand on affiche le dernier bâtiment
Browse files Browse the repository at this point in the history
  • Loading branch information
etienneCharignon authored and Guitguitou committed Mar 25, 2022
1 parent fa486a5 commit 1570f79
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/situations/accueil/vues/accueil.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ export default {
glisseVersDernierBatimentNonVisite () {
this.indexBatiment = this.niveauMax;
if(this.termine) {
this.$store.dispatch('termineEvaluation');
}
},
reinitialiseDonnees () {
Expand Down
20 changes: 19 additions & 1 deletion tests/situations/accueil/vues/accueil.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ describe('La vue accueil', function () {
});
});

describe('#termine', function () {
describe('#terminé', function () {
let wrapper;

beforeEach(function () {
Expand Down Expand Up @@ -334,4 +334,22 @@ describe('La vue accueil', function () {
});
});
});

describe("#glisseVersDernierBatimentNonVisité", function () {
let wrapper;

beforeEach(function () {
store.state.situations = [{ nom: 'Inventaire' }];
store.state.situationsFaites = ['Inventaire'];
wrapper = accueil();
});

it("termine l'évaluation si on est arrivé sur le dernier batiment", function (done) {
store.dispatch = (evenement) => {
expect(evenement).toEqual('termineEvaluation');
done();
};
wrapper.vm.glisseVersDernierBatimentNonVisite();
});
});
});

0 comments on commit 1570f79

Please sign in to comment.