mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Backport #28089 by @KN4CK3R Fixes #28088 Fixes #28094 Added missing tests. Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		| @@ -155,6 +155,19 @@ func TestMatrixPayload(t *testing.T) { | ||||
| 		assert.Equal(t, `[<a href="http://localhost:3000/test/repo">test/repo</a>] Repository created by <a href="https://try.gitea.io/user1">user1</a>`, pl.(*MatrixPayload).FormattedBody) | ||||
| 	}) | ||||
|  | ||||
| 	t.Run("Package", func(t *testing.T) { | ||||
| 		p := packageTestPayload() | ||||
|  | ||||
| 		d := new(MatrixPayload) | ||||
| 		pl, err := d.Package(p) | ||||
| 		require.NoError(t, err) | ||||
| 		require.NotNil(t, pl) | ||||
| 		require.IsType(t, &MatrixPayload{}, pl) | ||||
|  | ||||
| 		assert.Equal(t, `[[GiteaContainer](http://localhost:3000/user1/-/packages/container/GiteaContainer/latest)] Package published by [user1](https://try.gitea.io/user1)`, pl.(*MatrixPayload).Body) | ||||
| 		assert.Equal(t, `[<a href="http://localhost:3000/user1/-/packages/container/GiteaContainer/latest">GiteaContainer</a>] Package published by <a href="https://try.gitea.io/user1">user1</a>`, pl.(*MatrixPayload).FormattedBody) | ||||
| 	}) | ||||
|  | ||||
| 	t.Run("Wiki", func(t *testing.T) { | ||||
| 		p := wikiTestPayload() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user