ra-aws-amplify icon indicating copy to clipboard operation
ra-aws-amplify copied to clipboard

Jest tests for RaAmplifyPagination & reducer

Open mayteio opened this issue 4 years ago • 0 comments

Test coverage for;

nextTokenReducer

  • an easy unit test, call it with {type: undefined}, expect null return
  • call it with { type: CRUD_GET_LIST_SUCCESS, payload: {nextToken: undefined} } - expect null return
  • call it with { type: CRUD_GET_LIST_SUCCESS, payload: {nextToken: "nextToken"} } expect nextToken return

UnconnectedRaAmplifyPagination

  • <UnconnectedRaAmplifyPagination page={1} nextToken={null} /> - expect nothing returned
  • <UnconnectedRaAmplifyPagination page={1} nextToken="nextToken" /> - expect(getByText(/next/i)).toBeInTheDocument()
  • <UnconnectedRaAmplifyPagination page={2} nextToken=null /> - expect(getByText(/previous/i)).toBeInTheDocument()

mayteio avatar Mar 18 '20 06:03 mayteio