Add document switching tests.