added tests when both provided prevIndex and prevValue is provided