Commit 6d444b03 authored by Jérémie Passerat's avatar Jérémie Passerat

Sauvegarde avant essai pour résoudre un pb de tests

parent 838442fc
<template>
<div id="detail_filtre">
<!-- <button id="effacerFiltres" v-on:click="effacer_Filtres"></button>-->
<span v-bind:class="darktheme ? 'effacerFiltresDark' : 'effacerFiltres'" v-on:click="effacer_Filtres"></span>
<span id="effacerFiltres" v-bind:class="darktheme ? 'effacerFiltresDark' : 'effacerFiltres'" v-on:click="effacer_Filtres"></span>
<div id="filtresChoisis" v-for="(index) in filtres_Choisis" :key="index.filtre">
<span :id="JSON.stringify(index.filtre)" class="filtreChoisi"> {{affichageTag(index)}} <button class="supprimerFiltre" v-on:click="supprimer($event, index)"></button></span>
<span :id="JSON.stringify(index.filtre)" class="filtreChoisi"> {{affichageTag(index)}}
<button class="supprimerFiltre" v-on:click="supprimer($event, index)"></button></span>
<b-popover v-if="index.type === 'tags libres'" :target="JSON.stringify(index.filtre)" triggers="hover" placement="rightbottom">
<p>{{ index.filtre }}</p>
</b-popover>
......
......@@ -6,13 +6,13 @@
&& versionMax > 1" v-model="versionChoisie" v-on:change="changerVersion" >-->
<div id="typeEtSource">
Type : {{contenuClique.type}}<br>
Type : {{typeContenu}}<br>
Source : {{contenuClique.source}}
Source : {{sourceContenu}}
</div>
<div id="notePopularite">
Note version : {{noteContenu}}<br>
Popularité : {{contenuClique.popularite}}<br>
Popularité : {{populariteContenu}}<br>
</div>
<span id="tagsLibres" v-on:click="modifierTags">{{ titreModifierTags }}</span>
......@@ -111,7 +111,9 @@ export default {
populariteContenu: 0,
noteContenu: 0,
isModeTag: false,
titreModifierTags: "modifier Tags"
titreModifierTags: "modifier Tags",
typeContenu: '',
sourceContenu: ''
}
},
methods: {
......@@ -251,6 +253,9 @@ export default {
this.titreContenu = this.contenuClique.titre
this.noteContenu = this.calculerNoteContenu
this.typeContenu = this.contenuClique.type
this.sourceContenu = this.contenuClique.source
this.populariteContenu = this.contenuClique.popularite
this.isContenuRefuse = Object.prototype.hasOwnProperty.call(this.contenuClique, 'refuse');
......@@ -314,7 +319,7 @@ button {
text-align: center;
align-content: center;
display: flex;
margin: 0 auto -15px;
/*margin: 0 auto -15px;*/
}
#typeEtSource, #notePopularite {
......
......@@ -866,12 +866,23 @@ export default {
}
}
if (event.filtres.filter(contenu => contenu.type === 'recherche')) {
//alert("Nouveau filtre recherche")
let filtre_recherche = (event.filtres.filter(contenu => contenu.type === 'recherche'))
for (let itBe in filtre_recherche){
switch (filtre_recherche[itBe].choix){
case "titre":
contenusFiltres = contenusFiltres.filter(contenu => contenu.titre === filtre_recherche[itBe].filtre)
break
case "contenu":
alert("je recherche " + filtre_recherche[itBe].filtre + "dans le contenu")
break
case "titre&contenu":
alert("je recherche " + filtre_recherche[itBe].filtre + "dans le titre et dans le contenu")
break
}
}
}
// et on les réinjecte dans la "source"
if (this.panierChoisi){
this.contenus = contenusFiltres
......@@ -1051,8 +1062,8 @@ export default {
this.checkes = []
$(".horns").prop( "checked", false )
$(".horns").parent().parent().removeClass()
// alert($(".horns").parent().parent().parent().prop('nodeName'))
// alert($(".horns").parent().parent().prop('nodeName'))
// alert($(".horns").parent().parent().parent().prop('nodeName'))
// alert($(".horns").parent().parent().prop('nodeName'))
},
}
......
......@@ -22,7 +22,7 @@
<br>
<span id="validerRecherche" :class="(recherche.length === 0 || choixRecherche.length === 0) ? 'indisponible' : ''" @click="submit">Valider la recherche</span>
<br>
<p style="color: red; font-weight: bold">⚠ Pas câblé au tableau des contenus</p>
<p style="color: red; font-weight: bold">⚠ Pas câblé </p>
</div>
</template>
......@@ -45,14 +45,12 @@ export default {
if (this.recherche.length !== 0 && this.choixRecherche.length !== 0){
for (let mot in this.recherche.split(' ')){
this.$emit("creer_filtre", {filtre: this.recherche.split(' ')[mot], type: "recherche"})
this.$emit("creer_filtre", {filtre: this.recherche.split(' ')[mot], type: "recherche", choix: this.choixRecherche})
}
this.recherche = ''
this.choixRecherche = ''
}
}
}
}
......
......@@ -4,8 +4,4 @@ import Manuel from "../Manuel";
test('Manuel', () => {
const wrapper = shallowMount(Manuel)
expect(wrapper.vm.choixVariante).toHaveBeenCalledTimes(0);
})
\ No newline at end of file
......@@ -9,8 +9,8 @@ import NewContenu from "../NewContenu";
test('NewContenu', () => {
const wrapper = shallowMount(NewContenu)
expect(wrapper.vm.test).toEqual('')
expect(wrapper.vm.isCreation).toEqual(true)
wrapper.find('.ajouterContenu').trigger('click');
expect(wrapper.vm.test).toEqual('test')
expect(wrapper.vm.isCreation).toEqual(false)
})
\ No newline at end of file
......@@ -16,13 +16,9 @@ test('Profil', () => {
button.trigger('click');
expect(wrapper.vm.editMode).toEqual(true)
console.log(wrapper.vm.editMode)
button = wrapper.find('#afficherMenuChangementMdp')
button.trigger('click');
expect(wrapper.vm.editMode).toEqual(false)
console.log(wrapper.vm.editMode)
})
......@@ -7,15 +7,11 @@ import Volet_Base from "../components/Volet_Base";
import Volet_Menu from "../components/Volet_Menu";
import Volet_Contenu from "../components/Volet_Contenu";
// Rien a tester dans Index.vue, car c'est juste un "aggrégateur" pour d'autres composants.
// Rien a tester dans Volet_Menu.vue
test('Volet_Menu', () => {
const wrapper = shallowMount(Volet_Menu)
let button = wrapper.find('#recherche');
expect(wrapper.vm.modeFiltre).toEqual(true)
button.trigger('click');
expect(wrapper.vm.modeFiltre).toEqual(false)
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment