RezinaLMS-BackEnd/internal/domain/role_test.go
Yared Yemane 7ff22080f0 Disable exam-prep precedence locking for STUDENT learners.
Exam-prep content is gated by subscription/tier only. Learn English sequential locking is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 00:32:58 -07:00

33 lines
986 B
Go

package domain
import "testing"
func TestRoleOpenLearnerBypassesSubscriptionAndSequentialLocks(t *testing.T) {
role := RoleOpenLearner
if !role.BypassesSubscription() {
t.Fatal("OPEN_LEARNER must bypass subscription gates")
}
if role.UsesLMSSequentialGating() {
t.Fatal("OPEN_LEARNER must not use Learn English sequential locking")
}
if role.UsesExamPrepSequentialGating() {
t.Fatal("OPEN_LEARNER must not use exam-prep sequential locking")
}
if !role.IsCustomerLearnerRole() {
t.Fatal("OPEN_LEARNER should be a customer learner role")
}
}
func TestRoleStudentKeepsSubscriptionAndSequentialLocks(t *testing.T) {
role := RoleStudent
if role.BypassesSubscription() {
t.Fatal("STUDENT must not bypass subscription gates")
}
if !role.UsesLMSSequentialGating() {
t.Fatal("STUDENT must use Learn English sequential / precedence locking")
}
if role.UsesExamPrepSequentialGating() {
t.Fatal("STUDENT must not use exam-prep sequential / precedence locking")
}
}