How to use the store2.clearAll function in store2

To help you get started, we’ve selected a few store2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poanetwork / token-wizard / test / components / Home / index.spec.js View on Github external
it(`should navigate to Crowdsales List`, async () => {
    // Given
    const wrapper = mount(
      
        
      
    )
    const chooseCrowdsaleComponentWrapper = wrapper.find(ChooseCrowdsale)
    const instance = chooseCrowdsaleComponentWrapper.instance()
    const goToCrowdsalesHandler = jest.spyOn(instance, 'goToCrowdsales')
    instance.forceUpdate()
    storage.clearAll()

    // When
    const chooseCrowdsale = chooseCrowdsaleComponentWrapper.find('.hm-Home_BtnChoose')
    chooseCrowdsale.simulate('click')

    // Then
    expect(chooseCrowdsale.length).toBe(1)
    expect(goToCrowdsalesHandler).toHaveBeenCalledTimes(1)
    expect(goToCrowdsalesHandler).toHaveBeenCalledWith()
  })
})

store2

Better localStorage

MIT
Latest version published 10 months ago

Package Health Score

77 / 100
Full package analysis