Add some tests to verify that SchemaState is flushed when indexes come online

The behaviour is already correct in this regard. This PR just adds assurance that we don't break this in the future.