Skip to content

defaultState should change the currentState #1

@jogeshpi03

Description

@jogeshpi03

The currentState is not reflecting with the value based on defaultState value. Example:

<toggle-button :defaultState="true" />

Now the currentState should also be true. Test Case

it ('should work with dynamic state change', async () => {

    expect(wrapper.find('.toggle__label').text()).to.contain('Off');
    expect(wrapper.vm.currentState).to.be.false;

    wrapper.setProps({
        defaultState: true
    });

    await wrapper.vm.$nextTick();

    expect(wrapper.find('.toggle__label').text()).to.contain('On');
    expect(wrapper.vm.currentState).to.be.true;
});

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions