SHARE
TWEET

Untitled

a guest May 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. test('直接預設 store ,保管的 state 從 -3 開始', () => {
  2.    const store = createStore(reducer, {
  3.      count: -3,
  4.    });
  5.    
  6.    // 使用 renderWithRedux 回傳 render 後的結果
  7.    const { getByText, getByTestId } = renderWithRedux(<Counter />, { store, });
  8.    
  9.    // +2
  10.    fireEvent.click(getByText('點我加 2'));
  11.    expect(getByTestId('display_count').textContent).toBe('點了-1下');
  12.  });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top