From 3c07693fe3d06df8569f7406de606431fd7ef620 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Mon, 21 Oct 2024 09:50:18 +0700 Subject: [PATCH] Create security.test.js --- tests/security.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/security.test.js diff --git a/tests/security.test.js b/tests/security.test.js new file mode 100644 index 0000000..9e2439f --- /dev/null +++ b/tests/security.test.js @@ -0,0 +1,17 @@ +// tests/security.test.js +const { expect } = require('chai'); +const TwoFactorAuthContract = artifacts.require('TwoFactorAuthContract'); + +contract('TwoFactorAuthContract', (accounts) => { + let twoFactorAuth; + + before(async () => { + twoFactorAuth = await TwoFactorAuthContract.new(); + }); + + it('should enable two-factor authentication', async () => { + await twoFactorAuth.enableTwoFactorAuth(accounts[0]); + const isEnabled = await twoFactorAuth.twoFactorAuth(accounts[0]); + expect(isEnabled).to.be.true; + }); +});