Add transition to solutions

This commit is contained in:
Ramon Wenger 2019-02-04 18:54:55 +01:00
parent a08be83283
commit 07785ae2c1
2 changed files with 19 additions and 4 deletions

View File

@ -5,7 +5,9 @@ describe('Solutions', () => {
cy.visit('/module/lohn-und-budget');
cy.get('[data-cy=solution]').first()
.should('contain', 'anzeigen').then($solution => {
.should('contain', 'anzeigen')
.should('not.contain', 'Lösungssatz')
.then($solution => {
cy.wrap($solution).within(() => {
cy.get('[data-cy=show-solution]').click();
});

View File

@ -4,9 +4,11 @@
<template v-if="!visible">anzeigen</template>
<template v-else>ausblenden</template>
</a>
<p class="solution__text" data-cy="solution-text" v-if="visible">
{{value.text}}
</p>
<transition name="fade">
<p class="solution__text fade" data-cy="solution-text" v-if="visible">
{{value.text}}
</p>
</transition>
</div>
</template>
@ -44,6 +46,7 @@
/*margin-bottom: 15px;*/
display: block;
cursor: pointer;
font-weight: 400;
}
&__text {
@ -51,4 +54,14 @@
color: $color-grey;
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity .3s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
</style>