-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
218 additions
and
163 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* eslint-disable cypress/no-unnecessary-waiting */ | ||
/* eslint-disable require-jsdoc */ | ||
var Countly = require("../../lib/countly"); | ||
// import * as Countly from "../../dist/countly_umd.js"; | ||
var hp = require("../support/helper.js"); | ||
|
||
function initMain(name, version) { | ||
Countly.init({ | ||
app_key: "YOUR_APP_KEY", | ||
url: "https://your.domain.count.ly", | ||
test_mode: true, | ||
debug: true, | ||
sdk_name: name, | ||
sdk_version: version | ||
}); | ||
} | ||
|
||
const SDK_NAME = "javascript_native_web"; | ||
const SDK_VERSION = "23.12.1"; | ||
|
||
// tests | ||
describe("Bridged SDK Utilities Tests", () => { | ||
it("Check if we can override sdk name and version successful", () => { | ||
hp.haltAndClearStorage(() => { | ||
initMain("javascript_gtm_web", "24.0.0"); | ||
hp.events(); | ||
cy.fetch_local_request_queue().then((eq) => { | ||
expect(eq).to.have.length(1); | ||
expect(eq[0].sdk_name).to.equal("javascript_gtm_web"); | ||
expect(eq[0].sdk_version).to.equal("24.0.0"); | ||
}); | ||
}); | ||
}); | ||
it("Check if SDK uses default values if SDK name and version was not overriden", () => { | ||
hp.haltAndClearStorage(() => { | ||
initMain(undefined, undefined); | ||
hp.events(); | ||
cy.fetch_local_request_queue().then((eq) => { | ||
expect(eq).to.have.length(1); | ||
expect(eq[0].sdk_name).to.equal(SDK_NAME); | ||
expect(eq[0].sdk_version).to.equal(SDK_VERSION); | ||
}); | ||
}); | ||
}); | ||
}); |
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.