RezinaLMS-BackEnd/internal/domain/catalog_archive_test.go

15 lines
502 B
Go

package domain
import "testing"
func TestArchivedCatalogCoursesAreNeverLearnerVisible(t *testing.T) {
for _, status := range []ContentPublishStatus{ContentPublishPublished, ContentPublishDraft} {
if (ExamPrepCatalogCourse{IsArchived: true, PublishStatus: status}).VisibleToLearners() {
t.Fatal("archived course leaked to learners")
}
}
if !(ExamPrepCatalogCourse{PublishStatus: ContentPublishPublished}).VisibleToLearners() {
t.Fatal("active published course should remain visible")
}
}