mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
35 lines
565 B
Go
35 lines
565 B
Go
package admin
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
|
|
)
|
|
|
|
// this implements the "given" part of given/when/then
|
|
type Context struct {
|
|
t *testing.T
|
|
}
|
|
|
|
func Given(t *testing.T) *Context {
|
|
t.Helper()
|
|
fixture.EnsureCleanState(t)
|
|
return GivenWithSameState(t)
|
|
}
|
|
|
|
func GivenWithSameState(t *testing.T) *Context {
|
|
t.Helper()
|
|
return &Context{t}
|
|
}
|
|
|
|
func (c *Context) And(block func()) *Context {
|
|
block()
|
|
return c
|
|
}
|
|
|
|
func (c *Context) When() *Actions {
|
|
time.Sleep(fixture.WhenThenSleepInterval)
|
|
return &Actions{context: c}
|
|
}
|