Improve tests
Use alert to signal incorrect component type