From 0cee67324c3b0badcce9cd9f6c4786152dfb1a12 Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Thu, 25 Jul 2013 14:26:02 +0300 Subject: [PATCH] Add new unit tests. --- tests/unit/cowhide-button.js | 4 ++++ tests/unit/cowhide-checkbox-input.js | 4 ++++ tests/unit/cowhide-header.js | 4 ++++ tests/unit/cowhide-page.js | 4 ++++ tests/unit/cowhide-radio-input.js | 4 ++++ tests/unit/cowhide-select.js | 4 ++++ tests/unit/cowhide-simple-scrollable.js | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/tests/unit/cowhide-button.js b/tests/unit/cowhide-button.js index 4a540be..4fef898 100644 --- a/tests/unit/cowhide-button.js +++ b/tests/unit/cowhide-button.js @@ -13,6 +13,10 @@ $(function () { $.fn.ch_button = button }) + test("should be defined on jquery object", function () { + ok($(document.body).ch_button, 'button method is defined') + }) + test("should be disabled when driving", function () { var page = $('
') var btn = $('') diff --git a/tests/unit/cowhide-checkbox-input.js b/tests/unit/cowhide-checkbox-input.js index fdd54be..adfa71b 100644 --- a/tests/unit/cowhide-checkbox-input.js +++ b/tests/unit/cowhide-checkbox-input.js @@ -13,6 +13,10 @@ $(function () { $.fn.ch_checkbox_input = input }) + test("should be defined on jquery object", function () { + ok($(document.body).ch_checkbox_input, 'checkbox_input method is defined') + }) + test("should be disabled when driving", function () { var page = $('
') var input = $('test') diff --git a/tests/unit/cowhide-header.js b/tests/unit/cowhide-header.js index 3e5f06b..b813995 100644 --- a/tests/unit/cowhide-header.js +++ b/tests/unit/cowhide-header.js @@ -8,6 +8,10 @@ $(function () { $.fn.ch_header = header }) + test("should be defined on jquery object", function () { + ok($(document.body).ch_header, 'header method is defined') + }) + test("header contains h1 element", function () { var page = $('
') var header = $('
Test title
') diff --git a/tests/unit/cowhide-page.js b/tests/unit/cowhide-page.js index 37f0624..7590709 100644 --- a/tests/unit/cowhide-page.js +++ b/tests/unit/cowhide-page.js @@ -2,6 +2,10 @@ $(function () { module("cowhide-page") + test("should be defined on jquery object", function () { + ok($(document.body).ch_page, 'page method is defined') + }) + test("pages cannot be nested", function () { var page = $('
') var nested = $('
') diff --git a/tests/unit/cowhide-radio-input.js b/tests/unit/cowhide-radio-input.js index caf114e..4e53f74 100644 --- a/tests/unit/cowhide-radio-input.js +++ b/tests/unit/cowhide-radio-input.js @@ -13,6 +13,10 @@ $(function () { $.fn.ch_radio_input = input }) + test("should be defined on jquery object", function () { + ok($(document.body).ch_radio_input, 'radio_input method is defined') + }) + test("should be disabled when driving", function () { var page = $('
') var input = $('test') diff --git a/tests/unit/cowhide-select.js b/tests/unit/cowhide-select.js index 70e49f2..bcde4e2 100644 --- a/tests/unit/cowhide-select.js +++ b/tests/unit/cowhide-select.js @@ -13,6 +13,10 @@ $(function () { $.fn.ch_select = select }) + test("should be defined on jquery object", function () { + ok($(document.body).ch_select, 'select method is defined') + }) + test("should be disabled when driving", function () { var page = $('
') var input = $('') diff --git a/tests/unit/cowhide-simple-scrollable.js b/tests/unit/cowhide-simple-scrollable.js index 1276daf..b55b949 100644 --- a/tests/unit/cowhide-simple-scrollable.js +++ b/tests/unit/cowhide-simple-scrollable.js @@ -8,6 +8,10 @@ $(function () { $.fn.ch_simple_scrollable = simple_scrollable }) + test("should be defined on jquery object", function () { + ok($(document.body).ch_simple_scrollable, 'simple_scrollable method is defined') + }) + test("widget has been made scrollable", function () { var page = $('
') var scrollable = $('

Test

') -- 2.7.4