diff --git a/frontend_tests/casper_tests/10-admin.js b/frontend_tests/casper_tests/10-admin.js index 31b469e707..7e4b6ae51c 100644 --- a/frontend_tests/casper_tests/10-admin.js +++ b/frontend_tests/casper_tests/10-admin.js @@ -202,6 +202,31 @@ casper.then(function () { // TODO: Test stream deletion +// Test uploading realm icon image +casper.then(function () { + casper.click("li[data-section='organization-settings']"); + casper.test.assertExists('img#realm-settings-icon[src^="https://secure.gravatar.com/avatar/"]'); + casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), false); + casper.fill('form.admin-realm-form', { + realm_icon_file_input: 'static/images/logo/zulip-icon-128x128.png', + }, true); + casper.waitWhileVisible("#upload_icon_spinner .loading_indicator_spinner", function () { + casper.test.assertExists('img#realm-settings-icon[src^="/user_avatars/1/realm/icon.png?version=2"]'); + casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), true); + }); +}); + +// Test deleting realm icon image +casper.then(function () { + casper.click("li[data-section='organization-settings']"); + casper.click("#realm_icon_delete_button"); + casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), true); + casper.waitWhileVisible("#upload_icon_spinner .loading_indicator_spinner", function () { + casper.test.assertExists('img#realm-settings-icon[src^="https://secure.gravatar.com/avatar/"]'); + casper.test.assertEqual(casper.visible('#realm_icon_delete_button'), false); + }); +}); + casper.then(function () { casper.click("li[data-section='organization-settings']"); casper.waitUntilVisible('#id_realm_default_language', function () {