Tests

also the dom generation to a separate fn