Refactors the item (de)indexing tests.