@ -95,6 +95,21 @@ export default Component.extend(
return this.get('src') === result(this, 'defaults').src;
},
/**
* Return a shallow copy of the model's attributes for JSON
* stringification.
* @return {Object}
* @private
*/
toJSON(...args) {
const obj = Component.prototype.toJSON.apply(this, args);
if (obj.src === obj.attributes.src) {
delete obj.src;
}
return obj;
* Parse uri
* @param {string} uri
@ -8,6 +8,10 @@ describe('ComponentImage', () => {
componentImage = new ComponentImage();
});
test('`src` property is defined after initializing', () => {
expect(componentImage.get('src')).toBeDefined();
describe('.getAttrToHTML', () => {
let getSrcResultSpy;
const fakeAttributes = {};