mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-25 13:19:37 -05:00
Add integration test for EasyMDE button
(cherry picked from commit 089e37026f
)
This commit is contained in:
parent
99effab1eb
commit
ae128c617b
1 changed files with 25 additions and 0 deletions
25
tests/integration/easymde_test.go
Normal file
25
tests/integration/easymde_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEasyMDESwitch(t *testing.T) {
|
||||
session := loginUser(t, "user2")
|
||||
testEasyMDESwitch(t, session, "user2/glob/issues/1", false)
|
||||
testEasyMDESwitch(t, session, "user2/glob/issues/new", false)
|
||||
testEasyMDESwitch(t, session, "user2/glob/wiki?action=_new", true)
|
||||
testEasyMDESwitch(t, session, "user2/glob/releases/new", true)
|
||||
}
|
||||
|
||||
func testEasyMDESwitch(t *testing.T, session *TestSession, url string, expected bool) {
|
||||
t.Helper()
|
||||
req := NewRequest(t, "GET", url)
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
doc := NewHTMLParser(t, resp.Body)
|
||||
doc.AssertElement(t, ".combo-markdown-editor button.markdown-switch-easymde", expected)
|
||||
}
|
Loading…
Reference in a new issue