mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/15769] Fix JS and avatar functional tests
PHPBB3-15769
This commit is contained in:
parent
b3308245c3
commit
27c5f61e30
2 changed files with 10 additions and 9 deletions
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
// Ensure we have an img for the cropping
|
// Ensure we have an img for the cropping
|
||||||
if (this.$box.children('img').length === 0) {
|
if (this.$box.children('img').length === 0) {
|
||||||
const $avatarImg = $('<img/>');
|
const $avatarImg = $('<img src="" alt="">');
|
||||||
$avatarImg.addClass('avatar');
|
$avatarImg.addClass('avatar');
|
||||||
this.image = $avatarImg;
|
this.image = $avatarImg;
|
||||||
this.$box.prepend($avatarImg);
|
this.$box.prepend($avatarImg);
|
||||||
|
@ -181,15 +181,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle errors while deleting file
|
// Handle errors while deleting file
|
||||||
if (typeof response.error !== 'undefined') {
|
if (typeof response.error === 'undefined') {
|
||||||
phpbb.alert(response.error.title, response.error.messages.join('<br>'));
|
const alert = phpbb.alert(response.MESSAGE_TITLE, response.MESSAGE_TEXT);
|
||||||
} else {
|
|
||||||
alert = phpbb.alert(response.MESSAGE_TITLE, response.MESSAGE_TEXT);
|
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(() => {
|
||||||
window.location = response.REFRESH_DATA.url.replace('&', '&');
|
window.location = response.REFRESH_DATA.url.replace('&', '&');
|
||||||
|
alert.hide();
|
||||||
}, response.REFRESH_DATA.time * 1000);
|
}, response.REFRESH_DATA.time * 1000);
|
||||||
phpbb.avatars.destroy();
|
phpbb.avatars.destroy();
|
||||||
|
} else {
|
||||||
|
phpbb.alert(response.error.title, response.error.messages.join('<br>'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,12 @@ class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_av
|
||||||
),
|
),
|
||||||
// Gravatar with incorrect size
|
// Gravatar with incorrect size
|
||||||
array(
|
array(
|
||||||
'The submitted avatar is 120 wide and 120 high. Avatars must be at least 20 wide and 20 high, but no larger than 90 wide and 90 high.',
|
'The submitted avatar is 140 wide and 140 high. Avatars must be at least 40 wide and 40 high, but no larger than 120 wide and 120 high.',
|
||||||
'avatar_driver_gravatar',
|
'avatar_driver_gravatar',
|
||||||
array(
|
array(
|
||||||
'avatar_gravatar_email' => 'test@example.com',
|
'avatar_gravatar_email' => 'test@example.com',
|
||||||
'avatar_gravatar_width' => 120,
|
'avatar_gravatar_width' => 140,
|
||||||
'avatar_gravatar_height' => 120,
|
'avatar_gravatar_height' => 140,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Delete avatar image to reset group settings
|
// Delete avatar image to reset group settings
|
||||||
|
|
Loading…
Add table
Reference in a new issue