Added snippet and test for dynamically adding a custom element and setting an attribute of it.