I am very new to unit testing. I have reactive state usage in the component. would like to write unit testing for the component.
The example test component is defined below
<script setup lang="ts">
const state = reactive({
isExpired: true as boolean,
})
</script>
<template>
<div class="container" v-if="state.isExpired === false"></div>
</template>
Here, I want to check whether the container is rendering or not. isExpired value will be dynamically changed.
I have tried the test cases for the component as shared below
describe("Test suit for component",()=>{
let wrapper = shallowMount(TestComponent,{
isExpired : false
});
it("its should display container style",async ()=>{
expect(wrapper.find('.container').exists()).toBeTruthy();
});
});
I am not able to find the relevant unit testing in the online resources. Would like to know how to test the reactive state of component.