(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestSuperuserUpsertCommand(t *testing.T) { |
| 13 | t.Parallel() |
| 14 | |
| 15 | app, _ := tests.NewTestApp() |
| 16 | defer app.Cleanup() |
| 17 | |
| 18 | scenarios := []struct { |
| 19 | name string |
| 20 | email string |
| 21 | password string |
| 22 | expectError bool |
| 23 | }{ |
| 24 | { |
| 25 | "empty email and password", |
| 26 | "", |
| 27 | "", |
| 28 | true, |
| 29 | }, |
| 30 | { |
| 31 | "empty email", |
| 32 | "", |
| 33 | "1234567890", |
| 34 | true, |
| 35 | }, |
| 36 | { |
| 37 | "invalid email", |
| 38 | "invalid", |
| 39 | "1234567890", |
| 40 | true, |
| 41 | }, |
| 42 | { |
| 43 | "empty password", |
| 44 | "test@example.com", |
| 45 | "", |
| 46 | true, |
| 47 | }, |
| 48 | { |
| 49 | "short password", |
| 50 | "test_new@example.com", |
| 51 | "1234567", |
| 52 | true, |
| 53 | }, |
| 54 | { |
| 55 | "existing user", |
| 56 | "test@example.com", |
| 57 | "1234567890!", |
| 58 | false, |
| 59 | }, |
| 60 | { |
| 61 | "new user", |
| 62 | "test_new@example.com", |
| 63 | "1234567890!", |
| 64 | false, |
| 65 | }, |
| 66 | } |
| 67 | |
| 68 | for _, s := range scenarios { |
| 69 | t.Run(s.name, func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…