-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENG-3995] Embed OSF 101 video onto logged out homepage and no-conten…
…t dashboard - Part 2 (#1665) - Ticket: [ENG-3995] ## Purpose Add a video to the dashboard logged out page about how to use the OSF Add the same video and a link to the "Getting Started" guide on the logged in dashboard page without a collection. ## Summary of Changes Updated to .hbs files
- Loading branch information
Showing
7 changed files
with
227 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 143 additions & 0 deletions
143
tests/integration/components/osf-link/component-test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
import { render} from '@ember/test-helpers'; | ||
import Ember from 'ember'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
|
||
|
||
module('Integration | Component | osf-link', hooks => { | ||
setupRenderingTest(hooks); | ||
|
||
let orgOnError: any; | ||
hooks.beforeEach(function() { | ||
orgOnError = Ember.onerror; | ||
}); | ||
hooks.afterEach(function() { | ||
Ember.onerror = orgOnError; | ||
}); | ||
|
||
test('it renders the osf-link correctly for an @href', async assert => { | ||
await render(hbs` | ||
<OsfLink | ||
data-test-get-started-button | ||
data-analytics-name='Get started button' | ||
class='btn btn-primary' | ||
local-class='startButton' | ||
@target='_blank' | ||
@href='https://osf.io' | ||
> | ||
{{t 'dashboard.getting_started'}} | ||
</OsfLink> | ||
`); | ||
assert.dom('[data-test-get-started-button]').exists(); | ||
assert.dom('[data-test-get-started-button]').hasText('Getting Started'); | ||
assert.dom('[data-test-get-started-button]').hasClass('btn'); | ||
assert.dom('[data-test-get-started-button]').hasClass('btn-primary'); | ||
assert.dom('[data-test-get-started-button][href$="https://osf.io"]') | ||
.exists('The href https://osf.io is in the dom'); | ||
}); | ||
|
||
test('it renders the osf-link correctly for an empty @href', async assert => { | ||
await render(hbs` | ||
<OsfLink | ||
data-test-get-started-button | ||
data-analytics-name='Get started button' | ||
class='btn btn-primary' | ||
local-class='startButton' | ||
@target='_blank' | ||
@href=' ' | ||
> | ||
{{t 'dashboard.getting_started'}} | ||
</OsfLink> | ||
`); | ||
assert.dom('[data-test-get-started-button]').exists(); | ||
assert.dom('[data-test-get-started-button]').hasText('Getting Started'); | ||
assert.dom('[data-test-get-started-button]').hasClass('btn'); | ||
assert.dom('[data-test-get-started-button]').hasClass('btn-primary'); | ||
assert.dom('[data-test-get-started-button][href$=" "]') | ||
.exists('The empty href is in the dom'); | ||
}); | ||
|
||
test('it should throw an error without an array @models', async assert => { | ||
Ember.onerror = (error: Error) => { | ||
assert.equal(error.message, | ||
'Assertion Failed: `@models` must be undefined or an array. Consider using the `array` helper.'); | ||
}; | ||
|
||
await render(hbs` | ||
<OsfLink | ||
@models='error' | ||
data-test-get-started-button | ||
data-analytics-name='Get started button' | ||
class='btn btn-primary' | ||
local-class='startButton' | ||
@target='_blank' | ||
@href='https://osf.io' | ||
> | ||
{{t 'dashboard.getting_started'}} | ||
</OsfLink> | ||
`); | ||
}); | ||
|
||
test('it should throw an error without an @href or @route', async assert => { | ||
Ember.onerror = (error: Error) => { | ||
assert.equal(error.message, | ||
'Assertion Failed: Must pass `@href` xor `@route`. Did you pass `href` instead of `@href`?'); | ||
}; | ||
|
||
await render(hbs` | ||
<OsfLink | ||
data-test-get-started-button | ||
data-analytics-name='Get started button' | ||
class='btn btn-primary' | ||
local-class='startButton' | ||
@target='_blank' | ||
> | ||
{{t 'dashboard.getting_started'}} | ||
</OsfLink> | ||
`); | ||
}); | ||
|
||
test('it should throw an error with @href and @route set to empty', async assert => { | ||
Ember.onerror = (error: Error) => { | ||
assert.equal(error.message, | ||
'Assertion Failed: Both `@href` and `@route` were improperly set (probably to empty strings)'); | ||
}; | ||
|
||
await render(hbs` | ||
<OsfLink | ||
data-test-get-started-button | ||
data-analytics-name='Get started button' | ||
class='btn btn-primary' | ||
local-class='startButton' | ||
@target='_blank' | ||
@href='' | ||
@route='' | ||
> | ||
{{t 'dashboard.getting_started'}} | ||
</OsfLink> | ||
`); | ||
}); | ||
|
||
test('it should throw an error with @models and not @route', async assert => { | ||
Ember.onerror = (error: Error) => { | ||
assert.equal(error.message, | ||
'Assertion Failed: `@models` makes sense only with `@route`'); | ||
}; | ||
|
||
await render(hbs` | ||
<OsfLink | ||
data-test-get-started-button | ||
data-analytics-name='Get started button' | ||
class='btn btn-primary' | ||
local-class='startButton' | ||
@target='_blank' | ||
@href='should pass' | ||
@models={{array 'hello'}} | ||
> | ||
{{t 'dashboard.getting_started'}} | ||
</OsfLink> | ||
`); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters