test: restore bootstrap-path + which-legacy coverage (EGB-283)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Brian Majewski 2026-06-24 13:06:57 -07:00
parent 50b73083f1
commit ae52b8c077

View file

@ -134,6 +134,9 @@ make_second_identity() {
init_with_remote init_with_remote
create_project_dir myproj create_project_dir myproj
run "$SECRETS_BIN" push run "$SECRETS_BIN" push
# Simulate a legacy store (no recipients.txt) so recipients add triggers the
# bootstrap branch (if [ ! -e "$RECIPIENTS_FILE" ]) rather than the append path.
rm -f "$SECRETS_DIR/recipients.txt"
make_second_identity make_second_identity
run "$SECRETS_BIN" recipients add "$BOB_PUB" --name bob run "$SECRETS_BIN" recipients add "$BOB_PUB" --name bob
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
@ -255,3 +258,12 @@ make_second_identity() {
[[ "$output" == *"recipients: 2"* ]] || false [[ "$output" == *"recipients: 2"* ]] || false
[[ "$output" == *"bob"* ]] || false [[ "$output" == *"bob"* ]] || false
} }
@test "which reports single-key for a legacy store" {
init_with_remote
rm -f "$SECRETS_DIR/recipients.txt"
create_project_dir myproj
run "$SECRETS_BIN" which
[ "$status" -eq 0 ]
[[ "$output" == *"recipients: single-key"* ]] || false
}