overleaf/services/web/test/unit_frontend/es/support/fixture.js

19 lines
302 B
JavaScript
Raw Normal View History

2018-03-06 05:11:04 -05:00
class Fixture {
constructor() {
2018-03-06 05:11:04 -05:00
this.el = document.createElement('div')
2018-03-07 04:51:54 -05:00
document.body.appendChild(this.el)
2018-03-06 05:11:04 -05:00
}
load(html) {
2018-03-06 05:11:04 -05:00
this.el.innerHTML = html
return this.el.firstChild
}
cleanUp() {
2018-03-06 05:11:04 -05:00
this.el.innerHTML = ''
}
}
const fixture = new Fixture()
export default fixture