Как протестировать проверку Jest in Vue?

Как протестить (Jest) условия?

if (item.link) {
  if (this.$route.name !== item.routeName) {
    this.$router.push(item.link)
  }
}

const menu = [
  {title: '1', routeName: '/action', link: 'default'},
  {title: '2', routeName: '/logo', link: 'test'}
]

Мой тест

it('event', () => {
  const route = wrapper.vm.$route.name
  expect(
    wrapper.vm.menu.map((item: any) => {
      return (
        item === item.link.not.toMatch(route) &&
        expect(route).toBe(item.link)
      )
    })
  )
})

Ответы (0 шт):