Skip to content

Commit bb6a037

Browse files
remove tests that use disconnect
1 parent da8b5c8 commit bb6a037

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

src/integrationTests/async.spec.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,6 @@ testCookieAndLocalStorage(() => {
207207
return expect(uid2.getAdvertisingTokenAsync()).rejects.toBeInstanceOf(Error);
208208
});
209209
});
210-
211-
describe('when disconnect() has been called', () => {
212-
test('it should reject promise', () => {
213-
uid2.init({ identity: makeIdentity(), useCookie: useCookie });
214-
uid2.disconnect();
215-
return expect(uid2.getAdvertisingTokenAsync()).rejects.toBeInstanceOf(Error);
216-
});
217-
});
218210
});
219211

220212
describe('when getAdvertisingTokenAsync is called before refresh on init completes', () => {
@@ -224,13 +216,6 @@ testCookieAndLocalStorage(() => {
224216
beforeEach(() => {
225217
uid2.init({ identity: originalIdentity, useCookie: useCookie });
226218
});
227-
228-
describe('when promise obtained after disconnect', () => {
229-
test('it should reject promise', () => {
230-
uid2.disconnect();
231-
return expect(uid2.getAdvertisingTokenAsync()).rejects.toBeInstanceOf(Error);
232-
});
233-
});
234219
});
235220

236221
describe('when window.__uid2.init is called on SdkLoaded from a callback', () => {

src/integrationTests/basic.test.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -954,47 +954,6 @@ testCookieAndLocalStorage(() => {
954954
expect(xhrMock.abort).toHaveBeenCalledTimes(1);
955955
});
956956
});
957-
958-
describe('disconnect()', () => {
959-
test('should clear cookie', () => {
960-
setUid2(makeIdentityV2(), useCookie);
961-
uid2.disconnect();
962-
expect(getUid2(useCookie)).toBeNull();
963-
});
964-
test('should abort refresh timer', () => {
965-
uid2.init({
966-
callback: callback,
967-
identity: makeIdentityV2(),
968-
useCookie: useCookie,
969-
});
970-
expect(setTimeout).toHaveBeenCalledTimes(1);
971-
expect(clearTimeout).not.toHaveBeenCalled();
972-
uid2.disconnect();
973-
expect(setTimeout).toHaveBeenCalledTimes(1);
974-
expect(clearTimeout).toHaveBeenCalledTimes(1);
975-
});
976-
test('should abort refresh token request', () => {
977-
uid2.init({
978-
callback: callback,
979-
identity: makeIdentityV2({ refresh_from: Date.now() - 100000 }),
980-
useCookie: useCookie,
981-
});
982-
expect(xhrMock.send).toHaveBeenCalledTimes(1);
983-
expect(xhrMock.abort).not.toHaveBeenCalled();
984-
uid2.disconnect();
985-
expect(xhrMock.send).toHaveBeenCalledTimes(1);
986-
expect(xhrMock.abort).toHaveBeenCalledTimes(1);
987-
});
988-
test('should switch to unavailable state', () => {
989-
uid2.init({
990-
callback: callback,
991-
identity: makeIdentityV2(),
992-
useCookie: useCookie,
993-
});
994-
uid2.disconnect();
995-
(expect(uid2) as any).toBeInUnavailableState();
996-
});
997-
});
998957
});
999958

1000959
describe('Include sdk script multiple times', () => {

0 commit comments

Comments
 (0)