overleaf/services/web/test/karma/support/fixture.js

19 lines
302 B
JavaScript
Raw Normal View History

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