refactor: http service (#2233)

This commit is contained in:
Mo
2023-02-28 20:43:25 -06:00
committed by GitHub
parent 6e7618b258
commit e7f1d35341
142 changed files with 1116 additions and 1307 deletions

View File

@@ -68,7 +68,7 @@ describe('basic auth', function () {
this.application = await Factory.signOutApplicationAndReturnNew(this.application)
const response = await this.application.signIn(this.email, this.password, undefined, undefined, undefined, true)
expect(response).to.be.ok
expect(response.error).to.not.be.ok
expect(response.data.error).to.not.be.ok
expect(await this.application.protocolService.getRootKey()).to.be.ok
}).timeout(20000)
@@ -78,7 +78,7 @@ describe('basic auth', function () {
this.application = await Factory.signOutApplicationAndReturnNew(this.application)
const response = await this.application.signIn(this.email, this.password, undefined, undefined, undefined, true)
expect(response).to.be.ok
expect(response.error).to.not.be.ok
expect(response.data.error).to.not.be.ok
expect(await this.application.protocolService.getRootKey()).to.be.ok
let error
@@ -110,7 +110,7 @@ describe('basic auth', function () {
(async () => {
const response = await this.application.signIn(this.email, this.password, undefined, undefined, undefined, true)
expect(response).to.be.ok
expect(response.error).to.not.be.ok
expect(response.data.error).to.not.be.ok
expect(await this.application.protocolService.getRootKey()).to.be.ok
})(),
(async () => {
@@ -157,12 +157,12 @@ describe('basic auth', function () {
let response = await this.application.signIn(this.email, 'wrong password', undefined, undefined, undefined, true)
expect(response).to.have.property('status', 401)
expect(response.error).to.be.ok
expect(response.data.error).to.be.ok
response = await this.application.signIn(this.email, this.password, undefined, undefined, undefined, true)
expect(response.status).to.equal(200)
expect(response).to.not.haveOwnProperty('error')
expect(response.data).to.not.haveOwnProperty('error')
}).timeout(20000)
it('server retrieved key params should use our client inputted value for identifier', async function () {
@@ -203,7 +203,7 @@ describe('basic auth', function () {
this.application = await Factory.signOutApplicationAndReturnNew(this.application)
const response = await this.application.signIn(uppercase, this.password, undefined, undefined, undefined, true)
expect(response).to.be.ok
expect(response.error).to.not.be.ok
expect(response.data.error).to.not.be.ok
expect(await this.application.protocolService.getRootKey()).to.be.ok
}).timeout(20000)
@@ -219,7 +219,7 @@ describe('basic auth', function () {
this.application = await Factory.signOutApplicationAndReturnNew(this.application)
const response = await this.application.signIn(withspace, this.password, undefined, undefined, undefined, true)
expect(response).to.be.ok
expect(response.error).to.not.be.ok
expect(response.data.error).to.not.be.ok
expect(await this.application.protocolService.getRootKey()).to.be.ok
}).timeout(20000)
@@ -228,7 +228,7 @@ describe('basic auth', function () {
this.application = await Factory.signOutApplicationAndReturnNew(this.application)
const response = await this.application.signIn(this.email, 'wrongpassword', undefined, undefined, undefined, true)
expect(response).to.be.ok
expect(response.error).to.be.ok
expect(response.data.error).to.be.ok
expect(await this.application.protocolService.getRootKey()).to.not.be.ok
}).timeout(20000)
@@ -337,7 +337,7 @@ describe('basic auth', function () {
const signinResponse = await this.application.signIn(this.email, newPassword, undefined, undefined, undefined, true)
expect(signinResponse).to.be.ok
expect(signinResponse.error).to.not.be.ok
expect(signinResponse.data.error).to.not.be.ok
expect(await this.application.protocolService.getRootKey()).to.be.ok
@@ -420,7 +420,7 @@ describe('basic auth', function () {
)
expect(signinResponse).to.be.ok
expect(signinResponse.error).to.not.be.ok
expect(signinResponse.data.error).to.not.be.ok
expect(await this.application.protocolService.getRootKey()).to.be.ok
}
}).timeout(80000)