add widget encoding test