From 074a1ee6db458213ebef8230a9b67fbc6537c48b Mon Sep 17 00:00:00 2001 From: jez Date: Sun, 16 Jan 2011 04:28:32 +0800 Subject: Auto-generate test cases --- test_harnesses/automated.html | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'test_harnesses') diff --git a/test_harnesses/automated.html b/test_harnesses/automated.html index 2347f297..79e7ca8d 100644 --- a/test_harnesses/automated.html +++ b/test_harnesses/automated.html @@ -103,24 +103,12 @@ setup(function() { stub(settings.values, "filterLinkHints", "false"); initializeLinkHints(); - var testContent = - "test" + - "tress" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait" + - "trait"; - document.getElementById("test-div").innerHTML = testContent; + // we need at least 16 elements to have double-character link hints + for (var i = 0; i < 16; i++) { + var link = document.createElement("a"); + link.textContent = "test"; + document.getElementById("test-div").appendChild(link); + } linkHints.activateMode(); }), @@ -132,8 +120,7 @@ should("label the hints correctly", function() { var hintStrings = ["ss", "sa", "sd"]; for (var i = 0; i < 3; i++) - assert.equal(hintStrings[i], - linkHints.hintMarkers[i].getAttribute("hintString")); + assert.equal(hintStrings[i], linkHints.hintMarkers[i].getAttribute("hintString")); }), should("narrow the hints", function() { -- cgit v1.2.3