Skip to content

Commit 3e4ad3a

Browse files
committed
Updated integration test
1 parent 9ac0f78 commit 3e4ad3a

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

test/integration/qrCodeAuth.test.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -178,26 +178,26 @@ describe("QrCodeAuth", function () {
178178
});
179179

180180
it("should successfully fetch the user device info", function (done) {
181-
qrCodeAuthModel.storeUserDeviceInfo(userDeviceInfoData);
181+
qrCodeAuthModel.storeUserDeviceInfo(userDeviceInfoData).then((response) => {
182+
chai
183+
.request(app)
184+
.get(`/auth/qr-code-auth?device_id=${response.userDeviceInfoData.device_id}`)
185+
.end((err, res) => {
186+
if (err) {
187+
return done(err);
188+
}
189+
expect(res).to.have.status(200);
190+
expect(res.body).to.be.a("object");
191+
expect(res.body.data.user_id).to.be.a("string");
192+
expect(res.body.data.device_info).to.be.a("string");
193+
expect(res.body.data.device_id).to.be.a("string");
194+
expect(res.body.data.authorization_status).to.be.a("string");
195+
expect(res.body.data.access_token).to.be.a("string");
196+
expect(res.body.message).to.equal(`Authentication document retrieved successfully.`);
182197

183-
chai
184-
.request(app)
185-
.get(`/auth/qr-code-auth?device_id=${userDeviceInfoData.device_id}`)
186-
.end((err, res) => {
187-
if (err) {
188-
return done(err);
189-
}
190-
expect(res).to.have.status(200);
191-
expect(res.body).to.be.a("object");
192-
expect(res.body.data.user_id).to.be.a("string");
193-
expect(res.body.data.device_info).to.be.a("string");
194-
expect(res.body.data.device_id).to.be.a("string");
195-
expect(res.body.data.authorization_status).to.be.a("string");
196-
expect(res.body.data.access_token).to.be.a("string");
197-
expect(res.body.message).to.equal(`Authentication document retrieved successfully.`);
198-
199-
return done();
200-
});
198+
return done();
199+
});
200+
});
201201
});
202202

203203
it("should fail with 404, when the document is not found", function (done) {

0 commit comments

Comments
 (0)