Skip to content

Commit 7d2ddf9

Browse files
committed
Used dummy values
1 parent 2c40678 commit 7d2ddf9

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.talismanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ fileignoreconfig:
2929
- filename: lib/contentstackClient.js
3030
checksum: b61fcf4fea88b8328ffa9d29a1ed88fe23ee9c9ef0cbd458721dcb7c82d2432b
3131
- filename: test/unit/ContentstackClient-test.js
32-
checksum: 210e75d6620fcae59ca9db6ecab6101736e8227f5a557a111ac72176056a5769
32+
checksum: e712b74f37ea15afd2ac095fc2154f8c9f2ffe955659e77651da4a0d7079ec88
3333
version: "1.0"

test/unit/ContentstackClient-test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Contentstack Client', () => {
3434
})
3535
.catch(done)
3636
})
37-
37+
// Thi
3838
it('Contentstack Client get user info', done => {
3939
var mock = new MockAdapter(axios)
4040
mock.onGet('/user').reply(200, {
@@ -215,7 +215,7 @@ describe('Contentstack Client', () => {
215215
expect(data.user).to.deep.equal({
216216
217217
password: 'password123',
218-
tfa_token: '654321'
218+
tfa_token: '123456'
219219
})
220220
return [200, {
221221
user: {
@@ -229,7 +229,7 @@ describe('Contentstack Client', () => {
229229
.login({
230230
231231
password: 'password123',
232-
tfa_token: '654321'
232+
tfa_token: '123456'
233233
})
234234
.then(response => {
235235
expect(response.user.authtoken).to.equal('Test Auth With TFA')
@@ -240,7 +240,7 @@ describe('Contentstack Client', () => {
240240
})
241241

242242
it('should handle login with TOTP secret', done => {
243-
const mfaSecret = 'JBSWY3DPEHPK3PXP'
243+
const mfaSecret = 'MFASECRET'
244244

245245
mock.onPost('/user-session').reply(config => {
246246
const data = JSON.parse(config.data)
@@ -278,7 +278,7 @@ describe('Contentstack Client', () => {
278278
expect(data.user).to.deep.equal({
279279
280280
password: 'password123',
281-
tfa_token: '654321' // Should use this directly instead of generating from mfaSecret
281+
tfa_token: '123456'
282282
})
283283
return [200, {
284284
user: {
@@ -292,8 +292,8 @@ describe('Contentstack Client', () => {
292292
.login({
293293
294294
password: 'password123',
295-
tfa_token: '654321',
296-
mfaSecret: 'JBSWY3DPEHPK3PXP' // This should be ignored
295+
tfa_token: '123456',
296+
mfaSecret: 'MFASECRET'
297297
})
298298
.then(response => {
299299
expect(response.user.authtoken).to.equal('Test Auth Direct TFA')
@@ -374,7 +374,7 @@ describe('Contentstack Client', () => {
374374
expect(data.user).to.deep.equal({
375375
376376
password: 'password123',
377-
tfa_token: '123456' // Should use provided tfa_token, not generate from mfaSecret
377+
tfa_token: '123456'
378378
})
379379
return [200, {
380380
user: {
@@ -389,7 +389,7 @@ describe('Contentstack Client', () => {
389389
390390
password: 'password123',
391391
tfa_token: '123456',
392-
mfaSecret: 'JBSWY3DPEHPK3PXP' // This should be ignored
392+
mfaSecret: 'MFASECRET'
393393
})
394394
.then(response => {
395395
expect(response.user.authtoken).to.equal('Test Auth')
@@ -404,8 +404,8 @@ describe('Contentstack Client', () => {
404404
const data = JSON.parse(config.data)
405405
expect(data.user.email).to.equal('[email protected]')
406406
expect(data.user.password).to.equal('password123')
407-
expect(data.user.tfa_token).to.match(/^\d{6}$/) // Should be 6-digit number
408-
expect(data.user.mfaSecret).to.equal(undefined) // Should not be in request
407+
expect(data.user.tfa_token).to.match(/^\d{6}$/)
408+
expect(data.user.mfaSecret).to.equal(undefined)
409409
return [200, {
410410
user: {
411411
authtoken: 'Test Auth',
@@ -418,7 +418,7 @@ describe('Contentstack Client', () => {
418418
.login({
419419
420420
password: 'password123',
421-
mfaSecret: 'JBSWY3DPEHPK3PXP'
421+
mfaSecret: 'MFASECRET'
422422
})
423423
.then(response => {
424424
expect(response.user.authtoken).to.equal('Test Auth')

0 commit comments

Comments
 (0)