Skip to content

Commit

Permalink
realm-icon: Add realm icon frontend tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkanahin authored and timabbott committed Feb 27, 2017
1 parent a4f99fd commit 132534b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions frontend_tests/casper_tests/10-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 132534b

Please sign in to comment.