2023-01-12 10:57:44 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewMultiCookieDomainSuite() *MultiCookieDomainSuite {
|
2023-01-25 04:11:05 +00:00
|
|
|
return &MultiCookieDomainSuite{
|
|
|
|
BaseSuite: &BaseSuite{
|
|
|
|
Name: multiCookieDomainSuiteName,
|
|
|
|
},
|
|
|
|
}
|
2023-01-12 10:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type MultiCookieDomainSuite struct {
|
2023-01-25 04:11:05 +00:00
|
|
|
*BaseSuite
|
2023-01-12 10:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *MultiCookieDomainSuite) TestMultiCookieDomainFirstDomainScenario() {
|
2023-01-25 09:36:40 +00:00
|
|
|
suite.Run(s.T(), NewMultiCookieDomainScenario(BaseDomain, Example2DotCom, []string{"authelia_session"}, true))
|
2023-01-12 10:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *MultiCookieDomainSuite) TestMultiCookieDomainSecondDomainScenario() {
|
2023-01-25 09:36:40 +00:00
|
|
|
suite.Run(s.T(), NewMultiCookieDomainScenario(Example2DotCom, BaseDomain, []string{"example2_session"}, false))
|
2023-01-12 10:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *MultiCookieDomainSuite) TestMultiCookieDomainThirdDomainScenario() {
|
2023-01-25 09:36:40 +00:00
|
|
|
suite.Run(s.T(), NewMultiCookieDomainScenario(Example3DotCom, BaseDomain, []string{"authelia_session"}, true))
|
2023-01-12 10:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestMultiCookieDomainSuite(t *testing.T) {
|
|
|
|
if testing.Short() {
|
|
|
|
t.Skip("skipping suite test in short mode")
|
|
|
|
}
|
|
|
|
|
|
|
|
suite.Run(t, NewMultiCookieDomainSuite())
|
|
|
|
}
|