* MM-1946 Migrate tests from "web/web_test.go" to use testify #12794 Also changed call in commented out test for client. * refactor: re-introduce t.Run * Update web/web_test.go Co-Authored-By: Harrison Healey <harrisonmhealey@gmail.com>
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
4c7220d69a
Коммит
e83f83fa85
@@ -165,7 +165,7 @@ func TestPublicFilesRequest(t *testing.T) {
|
|||||||
func main() {
|
func main() {
|
||||||
plugin.ClientMain(&MyPlugin{})
|
plugin.ClientMain(&MyPlugin{})
|
||||||
}
|
}
|
||||||
|
|
||||||
`
|
`
|
||||||
// Compile and write the plugin
|
// Compile and write the plugin
|
||||||
backend := filepath.Join(pluginDir, pluginID, "backend.exe")
|
backend := filepath.Join(pluginDir, pluginID, "backend.exe")
|
||||||
@@ -220,11 +220,8 @@ func TestStatic(t *testing.T) {
|
|||||||
|
|
||||||
resp, err := http.Get(URL + "/static/root.html")
|
resp, err := http.Get(URL + "/static/root.html")
|
||||||
|
|
||||||
if err != nil {
|
assert.NoErrorf(t, err, "got error while trying to get static files %v", err)
|
||||||
t.Fatalf("got error while trying to get static files %v", err)
|
assert.Equalf(t, resp.StatusCode, http.StatusOK, "couldn't get static files %v", resp.StatusCode)
|
||||||
} else if resp.StatusCode != http.StatusOK {
|
|
||||||
t.Fatalf("couldn't get static files %v", resp.StatusCode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -254,9 +251,8 @@ func TestCheckClientCompatability(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, browser := range uaTestParameters {
|
for _, browser := range uaTestParameters {
|
||||||
t.Run(browser.Name, func(t *testing.T) {
|
t.Run(browser.Name, func(t *testing.T) {
|
||||||
if result := CheckClientCompatability(browser.UserAgent); result != browser.Result {
|
result := CheckClientCompatability(browser.UserAgent)
|
||||||
t.Fatalf("%s User Agent Test failed!", browser.Name)
|
require.Equalf(t, result, browser.Result, "user agent test failed for %s", browser.Name)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user