-
-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add instrumentor * add changes to increase code coverage * fix broken tests and cleanup unused code * Update yarn.lock * Add source-map-loader
- Loading branch information
1 parent
0079f56
commit 2a7a3a1
Showing
7 changed files
with
303 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ module.exports = { | |
} | ||
} | ||
] | ||
}; | ||
}; |
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,54 @@ | ||
/* global describe,it */ | ||
import assert from 'assert'; | ||
import Shepherd from '../src/js/shepherd.js'; | ||
// since importing non UMD, needs assignment | ||
window.Shepherd = Shepherd; | ||
|
||
describe('Shepherd', function() { | ||
describe('.Step()', function() { | ||
const instance = new Shepherd.Tour({ | ||
defaults: { | ||
classes: 'shepherd-theme-arrows', | ||
scrollTo: true | ||
} | ||
}); | ||
|
||
const testStep = instance.addStep('test', { | ||
id: 'test', | ||
text: 'This is a step for testing', | ||
classes: 'example-step-extra-class', | ||
buttons: [ | ||
{ | ||
text: 'Next', | ||
action: instance.next | ||
} | ||
] | ||
}); | ||
const showTestStep = instance.addStep('test2', { | ||
id: 'test2', | ||
text: 'Another Step' | ||
}); | ||
|
||
it('has all the correct properties', function() { | ||
const values = ['classes', 'scrollTo', 'id', 'text', 'buttons']; | ||
assert.deepEqual(values, Object.keys(testStep.options)); | ||
}); | ||
|
||
describe('.hide()', function() { | ||
it('shows step evoking method, regardless of order', function() { | ||
instance.start(); | ||
testStep.hide(); | ||
|
||
assert.notEqual(document.querySelector('[data-id=test]').getAttribute('hidden'), null); | ||
}); | ||
}); | ||
describe('.show()', function() { | ||
it('shows step evoking method, regardless of order', function() { | ||
showTestStep.show(); | ||
|
||
assert.equal(document.querySelector('[data-id=test2]').dataset.id, 'test2'); | ||
}); | ||
}); | ||
|
||
}); | ||
}); |
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
Oops, something went wrong.