import {expect, tap} from "tapbundle"; import {HaventecCloudPortal} from "../dist/index"; import * as request from "superagent"; import * as mockRequest from "superagent-mock"; import {LocalData} from "@haventec/common-js"; tap.test("it should test HaventecCloudPortal sessionValid - returning false", async () => { let ha = new HaventecCloudPortal("http://mytest.com", true); let ld1 : LocalData = new LocalData("testuser1", null, null, null, null, "TestApplicationUUID", null, null, null, null, null); let ld2 : LocalData = new LocalData("testuser2", null, null, null, null, "TestApplicationUUID", null, null, null, null, null); ha.getAuthService().getLocalDataService().setLocalData("testuser1", ld1); let ldRet: LocalData = ha.getAuthService().getLocalDataService().getLocalData('testuser1'); expect(ldRet.username).to.be.equal('testuser1'); ha.getAuthService().getLocalDataService().setLocalData("testuser2", ld2); let ldRet2: LocalData = ha.getAuthService().getLocalDataService().getLocalData('testuser2'); expect(ldRet2.username).to.be.equal('testuser2'); let ldRet3: LocalData = ha.getAuthService().getLocalDataService().getLocalData('testuser1'); expect(ldRet3.username).to.be.equal('testuser1'); }); tap.start()