|
|
@@ -60,7 +60,7 @@ function timeoutAsync(cb, delay) {
|
|
|
var done = assert.async();
|
|
|
assert.equal( window.location.pathname, '/', "location should be / at first" );
|
|
|
$linkToRepo1.trigger('click');
|
|
|
- assert.equal( window.location.pathname, '/example-repo1' );
|
|
|
+ assert.equal( window.location.pathname, '/example-repo1', "location should be /example-repo1" );
|
|
|
timeoutAsync(() => {
|
|
|
assert.equal( ($menuExample.find('a')).length, 1, "menu example should contain 1 entry" );
|
|
|
assert.equal( $menuExample.find('a:first').html(), "Test Example", "link to 1st example should be labelled 'Test Example'" );
|
|
|
@@ -73,6 +73,8 @@ function timeoutAsync(cb, delay) {
|
|
|
|
|
|
QUnit.test( "test nav to example", function( assert ) {
|
|
|
var done = assert.async();
|
|
|
+ $linkToRepo1.trigger('click');
|
|
|
+ assert.equal( window.location.pathname, '/example-repo1', "location should be /example-repo1" );
|
|
|
assert.equal( ($menuExample.find('a')).length, 1, "menu example should contain 1 entry" );
|
|
|
var $linkToExmp1 = $menuExample.find('a:first');
|
|
|
$linkToExmp1.trigger('click');
|
|
|
@@ -99,6 +101,28 @@ function timeoutAsync(cb, delay) {
|
|
|
done();
|
|
|
});
|
|
|
|
|
|
+ QUnit.test( "test adding a file", function( assert ) {
|
|
|
+ var done = assert.async();
|
|
|
+ $linkToRepo1.trigger('click');
|
|
|
+ var $linkToExmp1 = $menuExample.find('a:first');
|
|
|
+ $linkToExmp1.trigger( 'click' );
|
|
|
+ var $addFile = $('#add-file');
|
|
|
+ var $addFileAddBtn = $addFile.find('.add-btn');
|
|
|
+ var $addFileForm = $addFile.find('form');
|
|
|
+ assert.equal( $addFile.length, 1, "there should be one #add-file element" );
|
|
|
+ assert.equal( $addFileForm.length, 1, "#add-file should contain one form element" );
|
|
|
+ assert.ok( ! $addFileForm.is(':visible'), "the form element shouldn't be visible before clicking the + btn" );
|
|
|
+ assert.ok( $addFileForm.width() === 0, "the form element shouldn't be visible before clicking the + btn" );
|
|
|
+ // $addFileAddBtn.trigger( 'click' );
|
|
|
+ timeoutAsync(() => {
|
|
|
+ console.log( $addFileForm );
|
|
|
+ assert.ok( $addFileForm.is(':visible'), "clicking on the + btn should have made the form appear" );
|
|
|
+ assert.ok( $addFileForm.width() > 0, "clicking on the + btn should have made the form appear" );
|
|
|
+ done();
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
QUnit.test( "test nav back to home", function( assert ) {
|
|
|
var done = assert.async();
|
|
|
$homeLink.trigger('click');
|