Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3348922
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:36:06+00:00 2026-05-18T01:36:06+00:00

The introduction to QUnit over at netTuts.com spawns an interesting exchange (never resolved) over

  • 0

The introduction to QUnit over at netTuts.com spawns an interesting exchange (never resolved) over how to apply unit tests against actions that manipulate the DOM. The following quote (Alex York) gets to the crux:

What would be nice is that if you had
a function like this:

function add(a, b) { var result = a +
b;
$(“input#ResultTestBox”).val(result);

In the above test, I would love to
test two things: the addition of a and
b, and the result correctly being put
into a DOM element. I would love to
test the second thing by providing
some mock HTML. Possible?

But, like I said…unresolved. Resolvable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:36:06+00:00Added an answer on May 18, 2026 at 1:36 am

    The latest version of QUnit supports a #qunit-fixture element that lets you add HTML to the QUnit web page.

    E.g., in your HTML:

    <ol id="qunit-tests"></ol>
    <div id="qunit-fixture">test markup, will be hidden</div>
    

    and in your JavaScript:

    $('<input id="ResultTestBox" type="text"/>').appendTo('#qunit-fixture');
    var result = add(a, b);
    
    equals(result, $('input#ResultTestBox').val(), "testing result box value");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Introduction I've got a problem with my extension for Chrome. It supposed to show
Introduction : I have prior experience in programming (C, C++, Java), however, this is
Introduction I have been so annoyed by applications that have a startup dialog which
Introduction: Now I know this question could be very broad and it would be
INTRODUCTION I'm using excel downloads as a way of users downloading a score sheet,
Introduction: I'm trying to get additional fields to log with log4j, and its working
Introduction: I want to loop through XML files with flexible categories structure. Problem: I
Introduction We have an OpenID Provider which we created using the DotNetOpenAuth component. Everything
Introduction In a current project I'm working on we're using the ChartBoost SDK for
Introduction I have some sort of values that I might want to access several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.