I believe the consensus on unit tests is that each individual test should interact with the smallest surface possible (?).

I have a function I want to test, but it depends on some setup performed by other function.

Should I call these other function in my test, or manually setup the state as the tested function expects?

I.e.

```
test function_remove_item:
  // setup the test
  state = clone(initial_state)
  item = new Item('an-id')
  // !!! Call another function to setup the test state
  add_item(state, item) // blindly assume that add_item is functioning correctly (test it in a different test)

  // perform the test
  remove_item(state, item)
  expect(state.items).notToInclude(item)
  expect(state.ordered).NotToInclude('my-id')
  expect(state.some_other_complex_state).toPass()

```

vs

```
test function_remove_item
  state = clone(initial_state)
  // manually perform all the state setup without hitting add_item
  state.items.push(new Item('my-id'))
  state.ordered.push('my-id')
  state.some_other_complex_state = true
  // imagine remove_item may call other function that rely on
  // some other state
  state.nested_flag_for_function_check_item_status = true

  // perform the test
  remove_item(state, item)
  expect(state.items).notToInclude(item)
  expect(state.ordered).NotToInclude('my-id')
  expect(state.some_other_complex_state).toPass()

```

It seems that calling `add_item` in my test means the test is probably more maintainable since it's harder to misconfigure the state (and the requirements of that state may grow quite large) but also makes the test feel somehow "un-pure"?