use existing auth db method for identifier creation
[squeep-authentication-module] / test / lib / authenticator.js
index dea4a84427e2d9634b10e401a9084b1bea5370f9..534fd02df14165d8029582ab6c3a816b24fbfe9a 100644 (file)
@@ -60,18 +60,18 @@ describe('Authenticator', function () {
     it('covers success', async function () {
       const otpKey = '1234567890123456789012';
       await authenticator.createIdentifier(dbCtx, identifier, credential, otpKey);
-      assert(authenticator.db.authenticationInsertIdentifier.called);
+      assert(authenticator.db.authenticationUpsert.called);
     });
     it('covers failure', async function () {
       const expected = new Error('blah');
-      await authenticator.db.authenticationInsertIdentifier.rejects(expected);
+      await authenticator.db.authenticationUpsert.rejects(expected);
       // assert.rejects was not happy to handle this for some reason
       try {
         await authenticator.createIdentifier(dbCtx, identifier, credential);
         assert.fail('no expecte exception');
       } catch (e) {
         assert.deepStrictEqual(e, expected);
-        assert(authenticator.db.authenticationInsertIdentifier.called);
+        assert(authenticator.db.authenticationUpsert.called);
         assert(authenticator.logger.error.called);
         }
     });