Add more tests for the basket, move findLastItem function into utils.