forked from YahooArchive/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 29
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 YahooArchive#34 from lognormal/page-group-order
Page group order tests and .eslint changes
- Loading branch information
Showing
8 changed files
with
72 additions
and
12 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
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
38 changes: 38 additions & 0 deletions
38
tests/page-templates/04-page-params/01-page-group-order.html
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,38 @@ | ||
<%= header %> | ||
<%= boomerangSnippet %> | ||
<div class="cart-container" style="display: none"> | ||
<div id="cart-total">$444.44</div> | ||
</div> | ||
<script src="01-page-group-order.js" type="text/javascript"></script> | ||
<script> | ||
page_group_var = 111; | ||
page_group_fn = function() { | ||
return 222; | ||
} | ||
page_group_fn_2 = function() { | ||
return 333; | ||
} | ||
|
||
BOOMR_test.init({ | ||
testAfterOnBeacon: true, | ||
PageParams: { | ||
pageGroups: [ | ||
{ | ||
type: "Regexp", | ||
parameter1: "/no-match/", | ||
parameter2: "No Match" | ||
}, | ||
{ | ||
// this one should be the match (111) | ||
type: "Custom", | ||
parameter1: "page_group_var" | ||
}, | ||
{ | ||
type: "Custom", | ||
parameter1: "page_group_fn" | ||
} | ||
] | ||
} | ||
}); | ||
</script> | ||
<%= footer %> |
16 changes: 16 additions & 0 deletions
16
tests/page-templates/04-page-params/01-page-group-order.js
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,16 @@ | ||
/*eslint-env mocha*/ | ||
/*global BOOMR_test,assert*/ | ||
|
||
describe("e2e/04-page-params/00-page-groups", function() { | ||
var tf = BOOMR.plugins.TestFramework; | ||
var t = BOOMR_test; | ||
|
||
it("Should pass basic beacon validation", function(done) { | ||
t.validateBeaconWasSent(done); | ||
}); | ||
|
||
it("Should set the Page Group to 111", function() { | ||
var b = tf.lastBeacon(); | ||
assert.equal(b["h.pg"], 111); | ||
}); | ||
}); |