Skip to content

Commit 0f62f8a

Browse files
committed
test: Move variables to the owner fixture
1 parent 038bcf5 commit 0f62f8a

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

html/html_form_element_submit_test.go

+9-11
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/stretchr/testify/assert"
2121
)
2222

23-
type InitialHTMLFixture string
2423
type BaseLocationFixture string
2524

2625
type AssertFixture struct {
@@ -55,21 +54,16 @@ func (f *HTTPHandlerFixture) Setup() {
5554
type WindowFixture struct {
5655
AssertFixture
5756
*BaseLocationFixture
58-
InitialHTMLFixture
5957
*HTTPHandlerFixture
6058
Window htmltest.WindowHelper
6159

62-
requests []*http.Request
63-
form html.HTMLFormElement
64-
actualRequest *http.Request
65-
submittedForm url.Values
60+
form html.HTMLFormElement
6661
}
6762

6863
func (f *WindowFixture) Setup() {
6964
if f.Window.Window != nil {
7065
return
7166
}
72-
fmt.Println("Setup window")
7367
opts := html.WindowOptions{
7468
HttpClient: gosthttp.NewHttpClientFromHandler(f.HTTPHandlerFixture),
7569
}
@@ -89,10 +83,16 @@ func (f *WindowFixture) Setup() {
8983
))
9084
}
9185

86+
type HandlerFixture struct {
87+
}
88+
9289
type DefaultWindowFixture struct {
9390
WindowFixture
9491
*HTTPHandlerFixture
95-
initialized bool
92+
initialized bool
93+
actualRequest *http.Request
94+
submittedForm url.Values
95+
requests []*http.Request
9696
}
9797

9898
func (f *DefaultWindowFixture) Setup() {
@@ -342,11 +342,9 @@ func TestResubmitFormOn307Redirects(t *testing.T) {
342342
submittedForm url.Values
343343
)
344344

345-
w, setup := fixture.Init(
346-
t,
345+
w, setup := fixture.Init(t,
347346
&struct {
348347
HTMLFormSubmitInputFixture
349-
*HTTPHandlerFixture
350348
*BaseLocationFixture
351349
}{},
352350
)

0 commit comments

Comments
 (0)