Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#28929 closed Bug (fixed)

Incorrect example JS QUnit test

Reported by: Jan Fabry Owned by: Junji Wei
Component: Documentation Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The example QUnit test code in the "Contributing" part of the documentation uses the wrong kind of assertion. Meta-meta I think, so not important, but it's still an error :-)

...
    assert.equal($('.button').length === 1);
...

The assert.equal should either be assert.ok, or it should be assert.equal($('.button').length, 1) (or assert.strictEqual if you want the exact equivalent).

It's also in QUnit 1 format, while Django upgraded to QUnit 2 in https://github.com/django/django/pull/7715, which has a different syntax.

Change History (7)

comment:1 by Claude Paroz, 6 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

comment:2 by Junji Wei, 6 years ago

Owner: changed from nobody to Junji Wei
Status: newassigned

comment:3 by Junji Wei, 6 years ago

Resolution: fixed
Status: assignedclosed

comment:4 by Claude Paroz, 6 years ago

Has patch: set
Resolution: fixed
Status: closednew

It will be fixed only when committed into Django master. When a patch is available, just check the "Has patch" box.

in reply to:  4 comment:5 by Junji Wei, 6 years ago

Status: newassigned

Replying to Claude Paroz:

It will be fixed only when committed into Django master. When a patch is available, just check the "Has patch" box.

Sorry, I made a mistake.

comment:6 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 1ef8b30a:

Fixed #28929 -- Corrected QUnit examples.

comment:7 by Tim Graham <timograham@…>, 6 years ago

In f080111:

[2.0.x] Fixed #28929 -- Corrected QUnit examples.

Backport of 1ef8b30abed6ecf0c28517001e7fd8a84e6e47d3 from master

Note: See TracTickets for help on using tickets.
Back to Top