review
This commit is contained in:
parent
6ffc0d2c99
commit
6153017b62
22 changed files with 835 additions and 100 deletions
21
backend/internal/web/mapper/mapper_test.go
Normal file
21
backend/internal/web/mapper/mapper_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package mapper
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
servicemodel "github.com/danyel/go-guess/backend/internal/service/model"
|
||||
)
|
||||
|
||||
func TestInterviewOmitsReferenceAnswer(t *testing.T) {
|
||||
response := InterviewToWeb(servicemodel.Interview{
|
||||
Job: servicemodel.JobPosting{
|
||||
Questions: []servicemodel.Question{{
|
||||
ID: 1, Type: "code_review", Text: "Review this",
|
||||
CodeSnippet: "return nil", ReferenceAnswer: "Should return the error",
|
||||
}},
|
||||
},
|
||||
}, "http://localhost")
|
||||
if len(response.Job.Questions) != 1 || response.Job.Questions[0].CodeSnippet != "return nil" {
|
||||
t.Fatalf("expected participant-safe code question, got %#v", response)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue