|
|
@@ -87,12 +87,14 @@ function timeoutAsync(cb, delay) {
|
|
|
|
|
|
QUnit.test( "test adding a collection", function( assert ) {
|
|
|
var done = assert.async();
|
|
|
- var $addCollectionForm = $('#add-collection-form');
|
|
|
- var $addCollectionBtn = $('#add-collection-btn');
|
|
|
- assert.equal( $addCollectionForm.length, 1, "there should be one #add-collection-form element" );
|
|
|
- assert.equal( $addCollectionBtn.length, 1, "there should be one #add-collection-btn element" );
|
|
|
- $addCollectionBtn.trigger( 'click' );
|
|
|
- assert.ok( $addCollectionForm.is(':visible'), "clicking on #add-collection-btn should make appear the *-form element" );
|
|
|
+ var $addRepo = $('#add-repo');
|
|
|
+ var $addRepoAddBtn = $addRepo.find('.add-btn');
|
|
|
+ var $addRepoForm = $addRepo.find('form');
|
|
|
+ assert.equal( $addRepo.length, 1, "there should be one #add-repo element" );
|
|
|
+ assert.equal( $addRepoForm.length, 1, "#add-repo should contain one form element" );
|
|
|
+ assert.ok( $addRepoForm.is(':visible'), "the form element shouldn't be visible before clicking the + btn" );
|
|
|
+ $addRepoAddBtn.trigger( 'click' );
|
|
|
+ assert.ok( $addRepoForm.is(':visible'), "clicking on the + btn should have made the form appear" );
|
|
|
|
|
|
done();
|
|
|
});
|