changed test to listen to `flushComplete`