Skip to content

Commit

Permalink
Cosmetic Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Rıza Kat committed Nov 5, 2024
1 parent 3f84fb2 commit 544aec5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 18 deletions.
15 changes: 10 additions & 5 deletions test/tests_device_id.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ describe("Device ID tests", () => {
beforeEach(async() => {
await hp.clearStorage();
});
it("1.set_id with SDK generated to developer supplied", (done) => {

it("1- set_id with SDK generated to developer supplied", (done) => {
// initialize SDK
initMain(undefined);
validateSdkGeneratedId(Countly.get_device_id());
Expand All @@ -47,7 +48,8 @@ describe("Device ID tests", () => {
done();
}, hp.sWait);
});
it("2.set_id with developer supplied to developer supplied", (done) => {

it("2- set_id with developer supplied to developer supplied", (done) => {
// initialize SDK
initMain("ID2");
validateDeveloperSuppliedId("ID2");
Expand All @@ -61,15 +63,17 @@ describe("Device ID tests", () => {
done();
}, hp.sWait);
});
it("3.set_id with same custom id", (done) => {

it("3- set_id with same custom id", (done) => {
// initialize SDK
initMain("ID");
validateDeveloperSuppliedId("ID");
Countly.set_id("ID");
validateDeveloperSuppliedId("ID");
done();
});
it("4.set_id with same sdk generated id", (done) => {

it("4- set_id with same sdk generated id", (done) => {
// initialize SDK
initMain(undefined);
var id = Countly.get_device_id();
Expand All @@ -79,7 +83,8 @@ describe("Device ID tests", () => {
validateSdkGeneratedId(id);
done();
});
it("5.set_id with invalid ids", (done) => {

it("5- set_id with invalid ids", (done) => {
// initialize SDK
initMain(undefined);
var id = Countly.get_device_id();
Expand Down
36 changes: 23 additions & 13 deletions test/tests_device_id_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("Device ID type tests", () => {
beforeEach(async() => {
await hp.clearStorage();
});
it("1.Generated device ID", (done) => {
it("1- Generated device ID", (done) => {
// initialize SDK
initMain(undefined);
Countly.begin_session();
Expand All @@ -71,7 +71,8 @@ describe("Device ID type tests", () => {
done();
}, hp.sWait);
});
it("2.Developer supplied device ID", (done) => {

it("2- Developer supplied device ID", (done) => {
// initialize SDK
initMain("ID");
Countly.begin_session();
Expand All @@ -84,7 +85,8 @@ describe("Device ID type tests", () => {
done();
}, hp.sWait);
});
it("3.With stored dev ID and no new ID", (done) => {

it("3- With stored dev ID and no new ID", (done) => {
// initialize SDK
initMain("ID");
Countly.begin_session();
Expand All @@ -105,7 +107,8 @@ describe("Device ID type tests", () => {
}, hp.sWait);
}, hp.sWait);
});
it("4.With stored dev ID and with new ID", (done) => {

it("4- With stored dev ID and with new ID", (done) => {
// initialize SDK
initMain("ID");
Countly.begin_session();
Expand All @@ -126,7 +129,8 @@ describe("Device ID type tests", () => {
}, hp.sWait);
}, hp.sWait);
});
it("5.With stored generated ID and no new ID", (done) => {

it("5- With stored generated ID and no new ID", (done) => {
// initialize SDK
initMain(undefined);
Countly.begin_session();
Expand All @@ -149,7 +153,8 @@ describe("Device ID type tests", () => {
}, hp.sWait);
}, hp.sWait);
});
it("6.With stored generated ID and with new ID", (done) => {

it("6- With stored generated ID and with new ID", (done) => {
// initialize SDK
initMain(undefined);
Countly.begin_session();
Expand All @@ -172,7 +177,8 @@ describe("Device ID type tests", () => {
}, hp.sWait);
}, hp.sWait);
});
it("7.With stored dev ID and no new ID, flag set", (done) => {

it("7- With stored dev ID and no new ID, flag set", (done) => {
// initialize SDK
initMain("ID");
Countly.begin_session();
Expand All @@ -194,7 +200,7 @@ describe("Device ID type tests", () => {
}, hp.sWait);
});

it("8.With stored dev ID and with new ID, flag set", (done) => {
it("8- With stored dev ID and with new ID, flag set", (done) => {
setTimeout(() => {
// initialize SDK
initMain("ID");
Expand All @@ -217,7 +223,8 @@ describe("Device ID type tests", () => {
}, hp.lWait);
}, hp.lWait);
});
it("9.With stored sdk ID and no new ID, flag set", (done) => {

it("9- With stored sdk ID and no new ID, flag set", (done) => {
// initialize SDK
initMain(undefined);
Countly.begin_session();
Expand All @@ -241,7 +248,7 @@ describe("Device ID type tests", () => {
}, hp.sWait);
});

it("10.With stored sdk ID and with new ID, flag set", (done) => {
it("10- With stored sdk ID and with new ID, flag set", (done) => {
// initialize SDK
initMain(undefined);
Countly.begin_session();
Expand All @@ -264,7 +271,8 @@ describe("Device ID type tests", () => {
}, hp.sWait);
}, hp.sWait);
});
it("11.Change generated device ID", (done) => {

it("11- Change generated device ID", (done) => {
// initialize SDK
initMain(undefined);
Countly.change_id("changedID");
Expand All @@ -280,7 +288,8 @@ describe("Device ID type tests", () => {
}, hp.sWait);
}, hp.sWait);
});
it("12.Change developer supplied device ID", (done) => {

it("12- Change developer supplied device ID", (done) => {
// initialize SDK
initMain("ID");
Countly.change_id("changedID");
Expand All @@ -296,7 +305,8 @@ describe("Device ID type tests", () => {
}, hp.sWait);
}, hp.sWait);
});
it("13.Check new DeviceIdType interface is equal to common interface", (done) => {

it("13- Check new DeviceIdType interface is equal to common interface", (done) => {
setTimeout(() => {
assert.equal(Countly.DeviceIdType.DEVELOPER_SUPPLIED, cc.deviceIdTypeEnums.DEVELOPER_SUPPLIED);
assert.equal(Countly.DeviceIdType.SDK_GENERATED, cc.deviceIdTypeEnums.SDK_GENERATED);
Expand Down

0 comments on commit 544aec5

Please sign in to comment.