-
-
Notifications
You must be signed in to change notification settings - Fork 160
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 #244 from vladucu/enhance-mixpanel-config
Support optional Mixpanel init config options
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,4 +88,25 @@ module('mixpanel adapter', function(hooks) { | |
assert.ok(stub.firstCall.calledWith('[email protected]', 123), 'it sends the correct arguments and options'); | ||
assert.ok(stub.secondCall.calledWith('[email protected]'), 'it sends the correct arguments'); | ||
}); | ||
|
||
test("#init supports extra configs", function (assert) { | ||
const config = { | ||
token: "meowmeows", | ||
secure_cookie: true, | ||
batch_requests: false, | ||
}; | ||
const adapter = this.owner.factoryFor("ember-metrics@metrics-adapter:mixpanel").create({ config }); | ||
const init_stub = sandbox.stub(window.mixpanel, "init").callsFake(() => { | ||
return true; | ||
}); | ||
adapter.init(); | ||
|
||
assert.ok( | ||
init_stub.firstCall.calledWith(config.token, { | ||
secure_cookie: true, | ||
batch_requests: false, | ||
}), | ||
"it sends the correct config options" | ||
); | ||
}); | ||
}); |