2020-05-27 11:55:44 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PathPrefixSuite struct {
|
2021-11-05 13:14:42 +00:00
|
|
|
*RodSuite
|
2020-05-27 11:55:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewPathPrefixSuite() *PathPrefixSuite {
|
2023-01-25 04:11:05 +00:00
|
|
|
return &PathPrefixSuite{
|
|
|
|
RodSuite: NewRodSuite(pathPrefixSuiteName),
|
|
|
|
}
|
2020-05-27 11:55:44 +00:00
|
|
|
}
|
|
|
|
|
2023-01-25 09:36:40 +00:00
|
|
|
func (s *PathPrefixSuite) TestCheckEnv() {
|
|
|
|
s.Assert().Equal("/auth", GetPathPrefix())
|
|
|
|
}
|
|
|
|
|
2022-05-04 01:01:36 +00:00
|
|
|
func (s *PathPrefixSuite) Test1FAScenario() {
|
|
|
|
suite.Run(s.T(), New1FAScenario())
|
2020-05-27 11:55:44 +00:00
|
|
|
}
|
|
|
|
|
2022-05-04 01:01:36 +00:00
|
|
|
func (s *PathPrefixSuite) Test2FAScenario() {
|
|
|
|
suite.Run(s.T(), New2FAScenario())
|
2020-05-27 11:55:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *PathPrefixSuite) TestCustomHeaders() {
|
|
|
|
suite.Run(s.T(), NewCustomHeadersScenario())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *PathPrefixSuite) TestResetPasswordScenario() {
|
|
|
|
suite.Run(s.T(), NewResetPasswordScenario())
|
|
|
|
}
|
|
|
|
|
2023-01-25 09:36:40 +00:00
|
|
|
func (s *PathPrefixSuite) SetupSuite() {
|
|
|
|
s.T().Setenv("PathPrefix", "/auth")
|
|
|
|
}
|
|
|
|
|
2020-05-27 11:55:44 +00:00
|
|
|
func TestPathPrefixSuite(t *testing.T) {
|
2021-03-14 07:08:26 +00:00
|
|
|
if testing.Short() {
|
|
|
|
t.Skip("skipping suite test in short mode")
|
|
|
|
}
|
|
|
|
|
2020-05-27 11:55:44 +00:00
|
|
|
suite.Run(t, NewPathPrefixSuite())
|
|
|
|
}
|