Skip to content

Commit

Permalink
test(component): ensure stubbed component
Browse files Browse the repository at this point in the history
For stubbed components, use `findComponent` or `findAllComponents`
  • Loading branch information
lemredd committed Jan 10, 2023
1 parent fcf5bbe commit 338eea9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/CalculatorContainer/HistoryContainer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ describe("Component: CalculatorContainer/HistoryContainer", () => {
const props = {
historyList
}
const wrapper = shallowMount(Component, { props })
const wrapper = shallowMount(Component,{ props })

// mock `isShowingHistoryList = true`
const wrapperInternals = wrapper.vm as any
wrapperInternals.isShowingHistoryList = true
await nextTick()

const historyListHiddenByDefault = wrapper.find(".history-list.hidden-by-default")
const [historyListItem1] = historyListHiddenByDefault.findAll("li.history-item")
const [historyListItem1] = historyListHiddenByDefault.findAllComponents({ "name": "HistoryListItem" })
await historyListItem1.trigger("click")

const expectedEmission = wrapper.emitted("revertToChosenHistory")
Expand Down

0 comments on commit 338eea9

Please sign in to comment.