test case for toWidget* functions