summaryrefslogtreecommitdiff
path: root/tests/unit-tests/nocontents/nocontents-tests.js
blob: 8e504cf3884447d88506a34973d272f311dd7180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * Unit Test: Nocontents
 *
 * Minkyu Kang <mk7.kang@samsung.com>
 */

(function ($) {
	module("Nocontents");

	var unit_nocontents = function ( widget, type ) {
		var background,
			text,
			i;

		/* Create */
		widget.nocontents();

		ok( widget.hasClass("ui-nocontents"), "Create" );

		/* Check Background */
		background = widget.children( ".ui-nocontents-icon-" + type );
		ok( background, "Background" );

		/* Check Texts */
		text = widget.children("p");

		for ( i = 0; i < text.length; i++ ) {
			ok( $( text[i] ).hasClass("ui-nocontents-text"), "Text" + i );
		}
	};

	test( "text type", function () {
		unit_nocontents( $("#nocontents_text"), "text" );
	});

	test( "picture type", function () {
		unit_nocontents( $("#nocontents_pic"), "picture" );
	});

	test( "multimedia type", function () {
		unit_nocontents( $("#nocontents_mul"), "multimedia" );
	});

	test( "unnamed type", function () {
		unit_nocontents( $("#nocontents_un"), "unnamed" );
	});
}( jQuery ));