debian-mirror-gitlab/spec/frontend/__helpers__/dom_shims/image_element_properties.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
237 B
JavaScript
Raw Normal View History

2020-04-08 14:13:33 +05:30
Object.defineProperty(global.HTMLImageElement.prototype, 'src', {
get() {
2020-06-23 00:09:42 +05:30
return this.$_jest_src || this.getAttribute('src');
2020-04-08 14:13:33 +05:30
},
set(val) {
this.$_jest_src = val;
if (this.onload) {
this.onload();
}
},
});