This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from kate2753/gh72Target
Fix `grunt devES` task and split fixture set up and test specs into separate files
- Loading branch information
Showing
6 changed files
with
62 additions
and
36 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,25 @@ | ||
function setupFixture() { | ||
//create an element for shopping list | ||
let shoppingListDiv = document.createElement('div'); | ||
//set up shopping list | ||
shoppingListDiv.id = 'shopping-list'; | ||
shoppingListDiv.style.margin = '40px auto'; | ||
shoppingListDiv.style.width = '400px'; | ||
shoppingListDiv.innerHTML = | ||
'<style> #shopping-list li { margin-top: 5px; padding: 5px 3px; border: 1px solid black; list-style: none;}</style>' + | ||
'<ul>' + | ||
' <li>This is an example list for the sake of having some UI to point to.</li>' + | ||
' <li id="milk">Milk</li>' + | ||
' <li id="eggs">Eggs</li>' + | ||
' <li id="lettuce">Lettuce</li>' + | ||
' <li id="bread">Bread</li>' + | ||
' <li id="yogurt">Yogurt</li>' + | ||
'</ul>' + | ||
'<div class="fixedTarget" style="position: fixed; right: 300px; top: 150px; background: #CCC; padding: 10px;">' + | ||
' Fixed positioned element' + | ||
' <span>With child element in it</span>' + | ||
'</div>'; | ||
//insert shopping list into the DOM | ||
document.body.appendChild(shoppingListDiv); | ||
} | ||
setupFixture(); |
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,17 @@ | ||
describe('Callout missing target', () => { | ||
it('Should throw an exception when standalone callout does not have a valid target', () => { | ||
let calloutMgr = hopscotch.getCalloutManager(); | ||
let calloutID = 'callout-no-target'; | ||
expect(() => { | ||
calloutMgr.createCallout({ | ||
id: calloutID, | ||
target: 'totally-does-not-exist', | ||
placement: 'bottom', | ||
title: 'This test is fun!', | ||
content: 'This is how we test this library!' | ||
}); | ||
}).toThrow(new Error('Must specify an existing target element via \'target\' option.')); | ||
|
||
expect(calloutMgr.getCallout(calloutID)).toBeUndefined(); | ||
}); | ||
}); |