aboutsummaryrefslogtreecommitdiff
path: root/test/insert.t
blob: a78971ff42ece0bf7428e05dd294570f80b91bed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash

export test_description="Tests pass otp insert commands"

. ./setup.sh

test_expect_success 'Inserts a basic TOTP key' '
	"$PASS" init $KEY1 &&
	"$PASS" otp insert totp -s AAAAAAAAAAAAAAAAAAAAA totp-secret
'

test_expect_success 'Commits insert to git' '
	git init "$PASSWORD_STORE_DIR" &&
	"$PASS" init $KEY1 &&
	"$PASS" otp insert totp -s AAAAAAAAAAAAAAAAAAAAA totp-secret2 &&
	git log --no-decorate -1 | grep "Add given OTP secret for totp-secret2 to store."
'

test_done