mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
Merge pull request #6254 from kevinansfield/fix-profile-image
Fix teardown of gh-profile-image when fileStorage=false
This commit is contained in:
commit
4f05bbf6e1
@ -88,10 +88,12 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let $input = this.$('.js-file-input');
|
||||
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.$('.js-file-input').data()['blueimp-fileupload']) {
|
||||
this.$('.js-file-input').fileupload('destroy');
|
||||
if ($input.length && $input.data()['blueimp-fileupload']) {
|
||||
$input.fileupload('destroy');
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -43,6 +43,17 @@ describeComponent(
|
||||
expect(this.$()).to.have.length(1);
|
||||
});
|
||||
|
||||
it('renders and tears down ok with fileStorage:false', function () {
|
||||
this.set('fileStorage', false);
|
||||
|
||||
this.render(hbs`
|
||||
{{gh-profile-image fileStorage=fileStorage}}
|
||||
`);
|
||||
|
||||
expect(this.$()).to.have.length(1);
|
||||
expect(this.$('input')).to.have.length(0);
|
||||
}),
|
||||
|
||||
it('immediately renders the gravatar if valid email supplied', function () {
|
||||
let email = 'test@example.com';
|
||||
let expectedUrl = `http://www.gravatar.com/avatar/${md5(email)}?s=100&d=blank`;
|
||||
|
Loading…
Reference in New Issue
Block a user