Revert "Export"
[platform/framework/web/web-ui-fw.git] / tests / unit-tests / notification / notification-tests.js
1 /*
2  * Unit Test: Notification
3  *
4  * Minkyu Kang <mk7.kang@samsung.com>
5  */
6
7 (function ($) {
8         module("Notification");
9
10         var unit_notification = function ( widget, type ) {
11                 var notification,
12                         elem = ".ui-" + type,
13                         text;
14
15                 /* Create */
16                 widget.notification();
17
18                 notification = widget.children( elem );
19                 ok( notification, "Create" );
20
21                 /* Show */
22                 widget.notification("show");
23
24                 notification = widget.children( elem );
25                 ok( notification.hasClass("show"), "API: show" );
26
27                 /* Hide */
28                 widget.notification("hide");
29
30                 notification = widget.children( elem );
31                 ok( notification.hasClass("hide"), "API: hide" );
32
33                 /* hide when click */
34                 widget.notification("show");
35                 notification = widget.children( elem );
36                 notification.trigger("vmouseup");
37
38                 notification = widget.children( elem );
39                 ok( notification.hasClass("hide"), "Hide when click the notification" );
40
41                 text = notification.children("p");
42                 console.log(text);
43
44                 if ( type === "smallpopup" ) {
45                         ok( $( text[0] ).hasClass( "ui-smallpopup-text-bg" ), "Text" );
46                 } else {
47                         ok( $( text[0] ).hasClass( "ui-ticker-text1-bg" ), "Top Text" );
48                         ok( $( text[1] ).hasClass( "ui-ticker-text2-bg" ), "Bottom Text" );
49                 }
50         };
51
52         test( "smallpopup", function () {
53                 unit_notification( $("#smallpopup"), "smallpopup" );
54         });
55
56         test( "tickernoti", function () {
57                 unit_notification( $("#tickernoti"), "ticker" );
58         });
59 }( jQuery ));