Skip to content

Commit

Permalink
tests: add tests for empty override of autocomplete_headers
Browse files Browse the repository at this point in the history
  • Loading branch information
theseion committed Nov 8, 2023
1 parent dbfd8a8 commit bfb16d8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions runner/run_input_override_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,28 @@ func (s *inputOverrideTestSuite) TestApplyInputOverrideAutocompleteHeaders() {
s.Equal(overrideAutocompleteHeaders, *testInput.AutocompleteHeaders, "`AutocompleteHeaders` should have been overridden")
}

func (s *inputOverrideTestSuite) TestApplyInputOverrideNoAutocompleteHeaders() {
testInput := test.Input{
AutocompleteHeaders: func() *bool { b := false; return &b }(),
}
s.Nil(s.cfg.TestOverride.Overrides.AutocompleteHeaders)
s.Nil(s.cfg.TestOverride.Overrides.StopMagic)
test.ApplyInputOverrides(&s.cfg.TestOverride.Overrides, &testInput)

s.False(*testInput.AutocompleteHeaders, "`AutocompleteHeaders` should not have been overridden")
}

func (s *inputOverrideTestSuite) TestApplyInputOverrideNoStopMagic() {
testInput := test.Input{
StopMagic: func() *bool { b := true; return &b }(),
}
s.Nil(s.cfg.TestOverride.Overrides.AutocompleteHeaders)
s.Nil(s.cfg.TestOverride.Overrides.StopMagic)
test.ApplyInputOverrides(&s.cfg.TestOverride.Overrides, &testInput)

s.True(*testInput.StopMagic, "`AutocompleteHeaders` should not have been overridden")
}

func (s *inputOverrideTestSuite) TestApplyInputOverrideEncodedRequest() {
originalEncodedRequest := "originalbase64"
overrideEncodedRequest, err := getOverrideConfigValue("EncodedRequest")
Expand Down

0 comments on commit bfb16d8

Please sign in to comment.