Fix cart function unit tests