[BUGFIX] Wait until modal overlay is closed in tests