vendredi 3 janvier 2020

AssertionError: expected 'Add' to equal '8' + expected - actual Add +8

am trying to right test for a button that adds numbers in the component i have

<script>
    export default {
        name: "add",
        data: function () {
            return{
                total : ''
            }
        },
        methods: {
            add: function(){
                this.total = 3+5
            }
        }
    }
</script>

<style scoped>

</style>

The test is

describe('add.vue', () => {
    it('Add when the button is clicked', () => {
        const wrapper = mount(Add)
        wrapper.find('button').trigger('click')
        expect(wrapper.find('div').text()).to.equal('8')
    });
});

Am getting that error

Aucun commentaire:

Enregistrer un commentaire