Rather than all this complicated mocking of property getters, could we not just arrange for the `createElement` function to return a "mock" element object whose `textContent` property is always some specific string like "MOCK_TEXTCONTENT"?  Then we simply check in the test that decodeEntities returns this value when called from the appropriate browser.