Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eamahanna committed Oct 9, 2020
1 parent 1d1b9c8 commit a183580
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ define([

// Add ACL before going to the staging area
// If it fails, it'll just do so silently.
var $globusLink = this.$elem.find('.globus_linked');
var $globusLink = this.$elem.find('a.globus_linked');
$globusLink.click((e) => {
var globusWindow = window.open('', 'globus');
globusWindow.document.write('<html><body><h2 style="text-align:center; font-family:\'Oxygen\', arial, sans-serif;">Loading Globus...</h2></body></html>');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
<div class="upload-options">
Other ways to upload:
{{#if userInfo.globusLinked}}
<button class="globus_linked">Upload with Globus</button>
<button class="globus_linked" aria-label="link to new window to upload via globus">
<a href="{{globusUrl}}" target="_blank" class="globus_link">Upload with Globus</a>
</button>
{{else}}
<button class="globus_not_linked"><a href="https://docs.kbase.us/data/globus">Upload with Globus</a></button>
<button class="globus_not_linked" aria-label="link to kbase globus upload docs">
<a href="https://docs.kbase.us/data/globus">Upload with Globus</a>
</button>
{{/if}}
<button class="web_upload_div">Upload with URL</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"google_ad_conversion": "kR9OCLas4JgBEOy2pucC"
},
"comm_wait_timeout": 600000,
"config": "narrative-refactor",
"config": "dev",
"data_panel": {
"initial_sort_limit": 10000,
"max_name_length": 33,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = function (config) {
},
files: [
'kbase-extension/static/narrative_paths.js',
{pattern: 'test/unit/spec/**/*.js', included: false},
{pattern: 'test/unit/spec/narrative_core/upload/*.js', included: false},
{pattern: 'node_modules/jasmine-ajax/lib/mock-ajax.js', included: true},
{pattern: 'kbase-extension/static/ext_components/kbase-ui-plugin-catalog/src/plugin/modules/data/categories.yml', included: false, served: true},
{pattern: 'kbase-extension/static/**/*.css', included: false, served: true},
Expand Down
11 changes: 8 additions & 3 deletions test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,19 @@ define ([
});
linkedStagingViewer.render()
.then(() => {
expect($node.html()).toContain('Or upload to this staging area by using');
expect($node.html()).toContain('https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a&amp;destination_path=' + fakeUser);
var $globusButton = $node.find('.globus_linked');
expect($globusButton).toBeDefined();
expect($globusButton.html()).toContain('Upload with Globus');
expect($globusButton.html()).toContain('https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a&amp;destination_path=' + fakeUser);
done();
});
});

it('Should render properly without a Globus linked account', () => {
expect($targetNode.html()).not.toContain('Or upload to this staging area by using');
var $globusButton = $targetNode.find('.globus_not_linked');
expect($globusButton).toBeDefined();
expect($globusButton.html()).toContain('Upload with Globus');
expect($globusButton.html()).toContain('https://docs.kbase.us/data/globus');
});

it('Should start a help tour', function() {
Expand Down

0 comments on commit a183580

Please sign in to comment.