Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding override for gtm #459

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 23.12.1
- Added methods for bridged SDK usage

## 23.12.0
- You can now provide custom storage methods to the SDK
- You can now use the SDK in web workers
Expand Down
45 changes: 45 additions & 0 deletions cypress/integration/bridged_utils.js
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);
});
});
});
});
Loading
Loading