add test for generate preview
add test for failure of generate preview
begin test for generate.file