Skip to content

i want to know how to set composition API in mount second option plz #346

Answered by cexbrayat
byeongwan-kim asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @EXEM-KBW

You can simply do something like:

test('Change password value', async () => {
  const wrapper = mount(Password);
  // change the password value
  wrapper.vm.password = 'short';
  // refresh the DOM
  await nextTick();
  const input = wrapper.get('input');
  expect(input.element.value).toBe('short'); 
});

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@byeongwan-kim
Comment options

@cexbrayat
Comment options

Answer selected by byeongwan-kim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants