From 3a8711026f5642f824d9bece53d3e93c86e40363 Mon Sep 17 00:00:00 2001 From: Koeun Choi Date: Mon, 17 Dec 2012 15:14:18 +0900 Subject: [PATCH] remove autodividers unit test Change-Id: I5b36e32b2531b150a66e5511323ba4baf3e52e78 --- .../unit-tests/autodividers/autodividers-tests.js | 178 --------------------- tests/unit-tests/autodividers/index.html | 72 --------- tests/unit-tests/tests.js | 1 - 3 files changed, 251 deletions(-) delete mode 100644 tests/unit-tests/autodividers/autodividers-tests.js delete mode 100644 tests/unit-tests/autodividers/index.html diff --git a/tests/unit-tests/autodividers/autodividers-tests.js b/tests/unit-tests/autodividers/autodividers-tests.js deleted file mode 100644 index 4fa15ec..0000000 --- a/tests/unit-tests/autodividers/autodividers-tests.js +++ /dev/null @@ -1,178 +0,0 @@ -/* - * autodividers unit tests - */ - -(function ($) { - $.mobile.defaultTransition = "none"; - - module( "Autodividers" ); - - asyncTest( "Adds dividers based on first letters of list items.", function() { - $.testHelper.pageSequence([ - function() { - $.testHelper.openPage( '#autodividers-test' ); - }, - - function() { - var $new_page = $( '#autodividers-test' ); - - //ok( $new_page.hasClass( 'ui-page-active' ) ); - ok( $new_page.find( '.ui-li-divider' ).length === 4 ); - - start(); - } - ]); - }); - - asyncTest( "Responds to addition/removal of list elements.", function() { - $.testHelper.pageSequence([ - function() { - $.testHelper.openPage( '#autodividers-test' ); - }, - - function() { - var $new_page = $( '#autodividers-test' ); - //ok($new_page.hasClass( 'ui-page-active' )); - - var $listview = $new_page.find( 'ul' ); - - // should remove all existing dividers - ok( $new_page.find( 'li:contains("SHOULD REMOVE")' ).length === 0 ); - - // add li; should add an "X" divider - $listview.append( '
  • x is for xanthe
  • ' ); - ok( $new_page.find( '.ui-li-divider' ).length === 5 ); - ok( $new_page.find( '.ui-li-divider' ).is( ':contains("X")' ) ); - - // adding the same element again should create a valid list - // item but no new divider - ok( $new_page.find( '.ui-li-static' ).length === 5 ); - $listview.append( '
  • x is for xanthe
  • ' ); - ok( $new_page.find( '.ui-li-divider' ).length === 5 ); - ok( $new_page.find( '.ui-li-divider:contains("X")' ).length === 1 ); - ok( $new_page.find( '.ui-li-static' ).length === 6 ); - - // should ignore addition of non-li elements to the list - $listview.find( 'li:eq(0)' ).append( 'ignore me' ); - ok( $new_page.find( '.ui-li-divider' ).length === 5 ); - ok( $new_page.find( '.ui-li-static' ).length === 6 ); - - // add li with the same initial letter as another li - // but after the X li item; should add a second "B" divider to the - // end of the list - $listview.append( '
  • b is for barry
  • ' ); - ok( $new_page.find( '.ui-li-divider' ).length === 6 ); - ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 2 ); - - // remove the item with a repeated "b"; should remove the second - // "B" divider - $listview.find( 'li:contains("barry")' ).remove(); - ok( $new_page.find( '.ui-li-divider' ).length === 5 ); - ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 1 ); - - // remove li; should remove the "A" divider - $listview.find( 'li:contains("aquaman")' ).remove(); - ok( $new_page.find( '.ui-li-divider' ).length === 4 ); - ok( !$new_page.find( '.ui-li-divider' ).is( ':contains("A")' ) ); - - // adding another "B" item after "C" should create two separate - // "B" dividers - $listview.find( 'li:contains("catwoman")' ).after( '
  • b is for barry
  • ' ); - ok( $new_page.find( '.ui-li-divider' ).length === 5 ); - ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 2 ); - - // if two dividers with the same letter have only non-dividers - // between them, they get merged - - // removing catwoman should cause the two "B" dividers to merge - $listview.find( 'li:contains("catwoman")' ).remove(); - ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 1 ); - - // adding another "D" item before the "D" divider should only - // result in a single "D" divider after merging - $listview.find( 'li:contains("barry")' ).after( '
  • d is for dan
  • ' ); - ok( $new_page.find( '.ui-li-divider:contains("D")' ).length === 1 ); - - start(); - } - ]); - }); - - module( "Autodividers Selector" ); - - asyncTest( "Adds divider text from links.", function() { - $.testHelper.pageSequence([ - function() { - $.testHelper.openPage( '#autodividers-selector-test' ); - }, - - function() { - var $new_page = $( '#autodividers-selector-test' ); - //ok($new_page.hasClass( 'ui-page-active' )); - - // check we have the right dividers based on link text - var $list = $( '#autodividers-selector-test-list1' ); - ok( $list.find( '.ui-li-divider' ).length === 4 ); - ok( $list.find( '.ui-li-divider:eq(0):contains(A)' ).length === 1 ); - ok( $list.find( '.ui-li-divider:eq(1):contains(B)' ).length === 1 ); - ok( $list.find( '.ui-li-divider:eq(2):contains(C)' ).length === 1 ); - ok( $list.find( '.ui-li-divider:eq(3):contains(D)' ).length === 1 ); - - // check that adding a new item with link creates the right divider - $list.append( '
  • e is for ethel
  • ' ); - ok( $list.find( '.ui-li-divider:eq(4):contains(E)' ).length === 1 ); - - start(); - } - ]); - }); - - asyncTest( "Adds divider text based on custom selector.", function() { - $.testHelper.pageSequence([ - function() { - $.testHelper.openPage( '#autodividers-selector-test' ); - }, - - function() { - var $new_page = $( '#autodividers-selector-test' ); - //ok($new_page.hasClass( 'ui-page-active' )); - - // check we have the right dividers based on custom selector - var $list = $( '#autodividers-selector-test-list2' ); - ok( $list.find( '.ui-li-divider' ).length === 4 ); - ok( $list.find( '.ui-li-divider:eq(0):contains(E)' ).length === 1 ); - ok( $list.find( '.ui-li-divider:eq(1):contains(F)' ).length === 1 ); - ok( $list.find( '.ui-li-divider:eq(2):contains(G)' ).length === 1 ); - ok( $list.find( '.ui-li-divider:eq(3):contains(H)' ).length === 1 ); - - // check that adding a new item creates the right divider - $list.append( '
  • ' + - 'i is for impy
  • ' ); - - ok( $list.find( '.ui-li-divider:eq(4):contains(I)' ).length === 1 ); - - start(); - } - ]); - }); - - asyncTest( "Adds divider text based on full text selected by custom selector.", function() { - $.testHelper.pageSequence([ - function() { - $.testHelper.openPage( '#autodividers-selector-test' ); - }, - - function() { - var $new_page = $( '#autodividers-selector-test' ); - //ok($new_page.hasClass( 'ui-page-active' )); - - var $list = $( '#autodividers-selector-test-list3' ); - ok( $list.find( '.ui-li-divider' ).length === 2 ); - ok( $list.find( '.ui-li-divider:eq(0):contains(eddie)' ).length === 1 ); - ok( $list.find( '.ui-li-divider:eq(1):contains(frankie)' ).length === 1 ); - - start(); - } - ]); - }); -})(jQuery); diff --git a/tests/unit-tests/autodividers/index.html b/tests/unit-tests/autodividers/index.html deleted file mode 100644 index f0ee1e0..0000000 --- a/tests/unit-tests/autodividers/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - jQuery Mobile Autodividers Tests - - - - - - - - - - - - - - - -

    jQuery Mobile Autodividers Tests

    -

    -

    -
      -
    - -
    -
    -

    Autodivider Test

    -
    -
    -
      -
    • SHOULD REMOVE
    • -
    • a is for aquaman
    • -
    • b is for batman
    • -
    • c is for catwoman
    • -
    • d is for darkwing
    • -
    -
    -
    - -
    -
    -

    Autodivider Selector Test

    -
    -
    - - -
      -
    • eddie is for aquaman
    • -
    • frankie is for batman
    • -
    • georgie is for catwoman
    • -
    • henry is for darkwing
    • -
    - -
      -
    • eddie is smart
    • -
    • eddie is tough
    • -
    • frankie is scruffy
    • -
    • frankie is week
    • -
    -
    -
    - - - diff --git a/tests/unit-tests/tests.js b/tests/unit-tests/tests.js index 4b3af2d..e22f85b 100755 --- a/tests/unit-tests/tests.js +++ b/tests/unit-tests/tests.js @@ -1,7 +1,6 @@ var TESTS = { "testPages":[ // Put your test here - "autodividers", "button", "check", "tabbar", -- 2.7.4