-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change builtInButtons to buttons (#241)
* change all instances for builtInButtons to align with Shepherd docs for config * fix tests * update docs on buttons and change makeButton logic * Update buttons README * Update tour.js * Fix lint * Fix options map * Update tests * Move to separate file
- Loading branch information
1 parent
302a120
commit dcc1f25
Showing
9 changed files
with
840 additions
and
359 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, click } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
|
||
/** | ||
* This is in a separate file because it randomly fails when not run on its own | ||
*/ | ||
module('Acceptance | Buttons tests', function(hooks) { | ||
let tour; | ||
|
||
setupApplicationTest(hooks); | ||
|
||
hooks.beforeEach(function() { | ||
tour = this.owner.lookup('service:tour'); | ||
|
||
tour.set('confirmCancel', false); | ||
tour.set('modal', false); | ||
}); | ||
|
||
hooks.afterEach(async function() { | ||
return await tour.cancel(); | ||
}); | ||
|
||
test('Tour next, back, and cancel buttons work', async function(assert) { | ||
assert.expect(3); | ||
|
||
await visit('/'); | ||
|
||
await click('.toggleHelpModal'); | ||
await click(document.querySelector('.shepherd-element[style*="display: block"] .next-button')); | ||
assert.ok(document.querySelector('.shepherd-element[style*="display: block"] .back-button'), 'Ensure that the back button appears'); | ||
|
||
await click(document.querySelector('.shepherd-element[style*="display: block"] .back-button')); | ||
assert.notOk(document.querySelector('.shepherd-element[style*="display: block"] .back-button'), 'Ensure that the back button disappears'); | ||
|
||
await click(document.querySelector('.shepherd-element[style*="display: block"] .cancel-button')); | ||
assert.notOk(document.querySelector('.shepherd-element [class^=shepherd-button]'), 'Ensure that all buttons are gone, after exit'); | ||
}); | ||
}); |
Oops, something went wrong.