web/test/jstests/test_htmlhelpers.js
author Julien Cristau <julien.cristau@logilab.fr>
Mon, 18 May 2015 20:00:06 +0200
changeset 10436 6493c8bf521d
parent 10429 98ea2b865210
permissions -rw-r--r--
[test] don't leave NULL columns around when making an attribute required It doesn't matter on sqlite (it doesn't do ALTER COLUMN), but when running this test on postgresql it fails to add the 'NOT NULL' constraint otherwise.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
$(document).ready(function() {
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
10428
c961a301a90b [devtools] qunit: stop using global variables
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10427
diff changeset
     3
    QUnit.module("module2", {
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
      setup: function() {
10427
7677c0401864 [devtools] qunit: update to 1.18.0 (closes #5533333)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10426
diff changeset
     5
        $('#qunit-fixture').append('<select id="theselect" multiple="multiple" size="2">' +
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
    			'</select>');
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
      }
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
    });
5738
74bd8123fb07 [jstest] get back more tests writen during the sprint by vgodard
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5658
diff changeset
     9
10429
98ea2b865210 [devtools] qunit: use new assert APIs
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10428
diff changeset
    10
    QUnit.test("test first selected", function (assert) {
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    11
        $('#theselect').append('<option value="foo">foo</option>' +
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
    			     '<option selected="selected" value="bar">bar</option>' +
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    13
    			     '<option value="baz">baz</option>' +
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    14
    			     '<option selected="selecetd"value="spam">spam</option>');
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    15
        var selected = firstSelected(document.getElementById("theselect"));
10429
98ea2b865210 [devtools] qunit: use new assert APIs
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10428
diff changeset
    16
        assert.equal(selected.value, 'bar');
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    17
    });
5738
74bd8123fb07 [jstest] get back more tests writen during the sprint by vgodard
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5658
diff changeset
    18
10429
98ea2b865210 [devtools] qunit: use new assert APIs
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10428
diff changeset
    19
    QUnit.test("test first selected 2", function (assert) {
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    20
        $('#theselect').append('<option value="foo">foo</option>' +
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    21
    			     '<option value="bar">bar</option>' +
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    22
    			     '<option value="baz">baz</option>' +
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    23
    			     '<option value="spam">spam</option>');
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    24
        var selected = firstSelected(document.getElementById("theselect"));
10429
98ea2b865210 [devtools] qunit: use new assert APIs
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10428
diff changeset
    25
        assert.equal(selected, null);
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    26
    });
5738
74bd8123fb07 [jstest] get back more tests writen during the sprint by vgodard
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5658
diff changeset
    27
10428
c961a301a90b [devtools] qunit: stop using global variables
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10427
diff changeset
    28
    QUnit.module("visibilty");
10429
98ea2b865210 [devtools] qunit: use new assert APIs
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10428
diff changeset
    29
    QUnit.test('toggleVisibility', function (assert) {
10427
7677c0401864 [devtools] qunit: update to 1.18.0 (closes #5533333)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10426
diff changeset
    30
        $('#qunit-fixture').append('<div id="foo"></div>');
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
        toggleVisibility('foo');
10429
98ea2b865210 [devtools] qunit: use new assert APIs
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10428
diff changeset
    32
        assert.ok($('#foo').hasClass('hidden'), 'check hidden class is set');
5658
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    33
    });
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    34
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    35
});
7b9553a9db65 [ajax] refactor/cleanup low-level ajax functions
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    36