(t *testing.T)
| 733 | } |
| 734 | |
| 735 | func TestCredFail(t *testing.T) { |
| 736 | err := adp.CredFail(types.ParseUserId("usr"+testData.Creds[3].User), "tel") |
| 737 | if err != nil { |
| 738 | t.Error(err) |
| 739 | } |
| 740 | |
| 741 | // Check if fields updated |
| 742 | var got struct { |
| 743 | Retries int |
| 744 | UpdatedAt time.Time |
| 745 | CreatedAt time.Time |
| 746 | } |
| 747 | err = db.QueryRow(ctx, "SELECT retries, updatedat, createdat FROM credentials WHERE userid=$1 AND method=$2 AND value=$3", |
| 748 | decodeUid(testData.Creds[3].User), "tel", testData.Creds[3].Value).Scan(&got.Retries, &got.UpdatedAt, &got.CreatedAt) |
| 749 | if err != nil { |
| 750 | t.Fatal(err) |
| 751 | } |
| 752 | if got.Retries != 1 { |
| 753 | t.Error(mismatchErrorString("Retries count", got.Retries, 1)) |
| 754 | } |
| 755 | if got.UpdatedAt == got.CreatedAt { |
| 756 | t.Error("UpdatedAt field not updated") |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | func TestCredConfirm(t *testing.T) { |
| 761 | err := adp.CredConfirm(types.ParseUserId("usr"+testData.Creds[3].User), "tel") |
nothing calls this directly
no test coverage detected
searching dependent graphs…