mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
feat(ui): include MIME type for archive links in folder download (#7037)
This is the same PR as https://codeberg.org/forgejo/forgejo/pulls/6959, but for the new links from https://codeberg.org/forgejo/forgejo/pulls/4736. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7037 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Otto <otto@codeberg.org> Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
parent
8d8275caa8
commit
ea42b1eadb
2 changed files with 6 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package integration
|
||||
|
@ -55,9 +56,10 @@ func TestRepoDownloadArchiveSubdir(t *testing.T) {
|
|||
|
||||
t.Run("Frontend", func(t *testing.T) {
|
||||
resp := MakeRequest(t, NewRequestf(t, "GET", "/%s/src/branch/master/subdir", repo.FullName()), http.StatusOK)
|
||||
page := NewHTMLParser(t, resp.Body)
|
||||
|
||||
assert.Contains(t, resp.Body.String(), fmt.Sprintf("/%s/archive/master:subdir.zip", repo.FullName()))
|
||||
assert.Contains(t, resp.Body.String(), fmt.Sprintf("/%s/archive/master:subdir.tar.gz", repo.FullName()))
|
||||
page.AssertElement(t, fmt.Sprintf(".folder-actions a.archive-link[href='/%s/archive/master:subdir.zip'][type='application/zip']", repo.FullName()), true)
|
||||
page.AssertElement(t, fmt.Sprintf(".folder-actions a.archive-link[href='/%s/archive/master:subdir.tar.gz'][type='application/gzip']", repo.FullName()), true)
|
||||
})
|
||||
|
||||
t.Run("Backend", func(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue