Commit b1d7a1f0 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

test: check that keyshare user and email deletion correctly schedules the user/email for deletion

parent 437b212e
......@@ -55,6 +55,10 @@ func TestPostgresDBUserManagement(t *testing.T) {
err = db.scheduleUserRemoval(15, 0)
assert.NoError(t, err)
user, err = db.user(15)
require.NoError(t, err)
require.True(t, user.DeleteInProgress)
err = db.scheduleUserRemoval(15, 0)
assert.Error(t, err)
}
......@@ -202,6 +206,10 @@ func TestPostgresDBUserInfo(t *testing.T) {
err = db.scheduleEmailRemoval(17, "test@test.com", 0)
assert.NoError(t, err)
info, err = db.user(17)
assert.NoError(t, err)
assert.Equal(t, []userEmail{{Email: "test@test.com", DeleteInProgress: true}}, info.Emails)
// Need sleep here to ensure time has passed since delete
time.Sleep(1 * time.Second)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment