Migrate code from react test