popup: Write tests on templates

Close #764