mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-30 22:11:07 +00:00 
			
		
		
		
	- Massive replacement of changing `code.gitea.io/gitea` to `forgejo.org`. - Resolves forgejo/discussions#258 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7337 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Beowulf <beowulf@beocode.eu> Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
		
			
				
	
	
		
			42 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2024 The Forgejo Authors. All rights reserved.
 | |
| // SPDX-License-Identifier: MIT
 | |
| 
 | |
| package integration
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 	"testing"
 | |
| 
 | |
| 	"forgejo.org/tests"
 | |
| 
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| )
 | |
| 
 | |
| func TestViewMilestones(t *testing.T) {
 | |
| 	defer tests.PrepareTestEnv(t)()
 | |
| 
 | |
| 	req := NewRequest(t, "GET", "/user2/repo1/milestones")
 | |
| 	resp := MakeRequest(t, req, http.StatusOK)
 | |
| 
 | |
| 	htmlDoc := NewHTMLParser(t, resp.Body)
 | |
| 	search := htmlDoc.doc.Find(".list-header-search > .search > .input > input")
 | |
| 	placeholder, _ := search.Attr("placeholder")
 | |
| 	assert.Equal(t, "Search milestones…", placeholder)
 | |
| }
 | |
| 
 | |
| func TestMilestonesCount(t *testing.T) {
 | |
| 	defer tests.PrepareTestEnv(t)()
 | |
| 
 | |
| 	req := NewRequest(t, "GET", "/user2/repo1/milestones")
 | |
| 	resp := MakeRequest(t, req, http.StatusOK)
 | |
| 
 | |
| 	htmlDoc := NewHTMLParser(t, resp.Body)
 | |
| 
 | |
| 	openCount := htmlDoc.doc.Find("a[data-test-name='open-issue-count']").Text()
 | |
| 	assert.Contains(t, openCount, "2\u00a0Open")
 | |
| 
 | |
| 	closedCount := htmlDoc.doc.Find("a[data-test-name='closed-issue-count']").Text()
 | |
| 	assert.Contains(t, closedCount, "1\u00a0Closed")
 | |
| 
 | |
| 	assert.Empty(t, htmlDoc.doc.Find("a[data-test-name='all-issue-count']").Nodes)
 | |
| }
 |