Test: Task list / file delete

This commit is contained in:
HFO4
2020-02-21 12:09:43 +08:00
parent 9b3f5b0efd
commit 7dcc7a4880
5 changed files with 46 additions and 19 deletions

View File

@@ -35,3 +35,11 @@ func TestBuildSiteConfig(t *testing.T) {
})
asserts.Equal(uint(5), res.Data.(SiteConfig).User.ID)
}
func TestBuildTaskList(t *testing.T) {
asserts := assert.New(t)
tasks := []model.Task{{}}
res := BuildTaskList(tasks, 1)
asserts.NotNil(res)
}

View File

@@ -5,6 +5,7 @@ import (
"github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/duo-labs/webauthn/webauthn"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
"testing"
@@ -110,3 +111,10 @@ func TestBuildTagRes(t *testing.T) {
asserts.Equal("", res[0].Expression)
asserts.Equal("exp", res[1].Expression)
}
func TestBuildWebAuthnList(t *testing.T) {
asserts := assert.New(t)
credentials := []webauthn.Credential{{}}
res := BuildWebAuthnList(credentials)
asserts.Len(res, 1)
}