Add template preview tests for #322.