(t *testing.T)
| 204 | } |
| 205 | |
| 206 | func TestFlow_HandleConsentError(t *testing.T) { |
| 207 | for _, state := range []State{FlowStateConsentInitialized, FlowStateConsentUnused, FlowStateConsentError} { |
| 208 | f := Flow{} |
| 209 | require.NoError(t, faker.FakeData(&f)) |
| 210 | f.State = state |
| 211 | |
| 212 | expected := RequestDeniedError{} |
| 213 | require.NoError(t, faker.FakeData(&expected)) |
| 214 | |
| 215 | require.NoError(t, f.HandleConsentError(&expected)) |
| 216 | assert.Equal(t, FlowStateConsentError, f.State) |
| 217 | assert.WithinDuration(t, time.Now(), time.Time(f.ConsentHandledAt), 5*time.Second) |
| 218 | assert.Equal(t, &expected, f.ConsentError) |
| 219 | |
| 220 | assert.Zero(t, f.ConsentRemember) |
| 221 | assert.Zero(t, f.ConsentRememberFor) |
| 222 | assert.Zero(t, f.GrantedScope) |
| 223 | assert.Zero(t, f.GrantedAudience) |
| 224 | } |
| 225 | } |
nothing calls this directly
no test coverage detected