package model

import (
	"testing"

	"github.com/onsi/gomega"

	"github.com/pingcap-inc/clinic/pkg/db"
)

func Test_AddCluster(t *testing.T) {
	g := gomega.NewWithT(t)

	c := &db.Cluster{
		OrgID:     uint(1),
		ClusterID: "Test_AddCluster",
	}
	c, err := AddClusterIfPresent(c)
	g.Expect(err).To(gomega.Succeed())
	g.Expect(c.OrgID).To(gomega.Equal(uint(1)))
}

// func Test_ListCluster(t *testing.T) {
// 	g := gomega.NewWithT(t)

// 	c := &db.Cluster{
// 		OrgID:     uint(1),
// 		ClusterID: "Test_AddCluster",
// 		Name:      "abcd",
// 	}
// 	c, err := AddClusterIfPresent(c)
// 	g.Expect(err).To(gomega.Succeed())

// 	c = &db.Cluster{
// 		OrgID:     uint(1),
// 		ClusterID: "Test_abcdCluster123",
// 		Name:      "123",
// 	}
// 	c, err = AddClusterIfPresent(c)
// 	g.Expect(err).To(gomega.Succeed())

// 	cluster, totoal, err := ListClusters("abcd", uint(1), 0, 10)
// 	g.Expect(err).To(gomega.Succeed())
// 	g.Expect(totoal).To(gomega.Equal(int64(2)))
// 	g.Expect(len(cluster)).To(gomega.Equal(int(2)))

// }

//func Test_ListUploadFiles(t *testing.T) {
//	g := gomega.NewWithT(t)
//
//	up := &db.UploadFile{}
//	InsertUploadFile(up)
//}
