Attempting to write tests for this feature but it's proving painful