From 08905eb9a9039b38c032275a87b4f5602e5a63dd Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 5 Aug 2011 17:12:21 +0200 Subject: Fixed adding host without DNS reverse zone https://fedorahosted.org/freeipa/ticket/1481 Shows status dialog instead of error dialog (error 4304 is treated like success). Refactored error dialog. Added generic message dialog (IPA.message_dialog) Modified core tests to work with dialog. --- install/ui/test/ipa_tests.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'install/ui/test/ipa_tests.js') diff --git a/install/ui/test/ipa_tests.js b/install/ui/test/ipa_tests.js index 72a32783..079b022b 100644 --- a/install/ui/test/ipa_tests.js +++ b/install/ui/test/ipa_tests.js @@ -162,8 +162,10 @@ test("Testing successful IPA.command().", function() { "Checking ajax invocation counter" ); + var dialog = $('#error_dialog'); + ok( - !IPA.error_dialog, + dialog.length == 0, "The dialog box is not created." ); @@ -237,7 +239,8 @@ test("Testing unsuccessful IPA.command().", function() { on_error: error_handler }).execute(); - var dialog = IPA.error_dialog.parent('.ui-dialog'); + var dialog = $('#error_dialog'); + var ui_dialog = dialog.parent('.ui-dialog'); equals( ajax_counter, 1, @@ -245,7 +248,7 @@ test("Testing unsuccessful IPA.command().", function() { ); ok( - dialog.length == 1 && IPA.error_dialog.dialog('isOpen'), + ui_dialog.length == 1 && dialog.dialog('isOpen'), "The dialog box is created and open." ); @@ -255,7 +258,7 @@ test("Testing unsuccessful IPA.command().", function() { ); // search the retry button from the beginning - var retry = $('button', dialog).first(); + var retry = $('button', ui_dialog).first(); retry.trigger('click'); equals( @@ -270,8 +273,8 @@ test("Testing unsuccessful IPA.command().", function() { // search the retry button from the beginning again because the dialog // has been recreated - dialog = IPA.error_dialog.parent('.ui-dialog'); - retry = $('button', dialog).first(); + ui_dialog = $('#error_dialog').parent('.ui-dialog'); + retry = $('button', ui_dialog).first(); retry.trigger('click'); equals( @@ -286,8 +289,8 @@ test("Testing unsuccessful IPA.command().", function() { // search the cancel button from the beginning because the dialog has // been recreated - dialog = IPA.error_dialog.parent('.ui-dialog'); - var cancel = $('button', dialog).first().next(); + ui_dialog = $('#error_dialog').parent('.ui-dialog'); + var cancel = $('button', ui_dialog).first().next(); cancel.trigger('click'); equals( @@ -295,8 +298,10 @@ test("Testing unsuccessful IPA.command().", function() { "Checking ajax invocation counter" ); + dialog = $('#error_dialog'); + ok( - !IPA.error_dialog, + dialog.length == 0, "After cancel, the dialog box is closed." ); -- cgit