mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Test: Task list / file delete
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user