Skip to content
Snippets Groups Projects
Commit bb1723ff authored by Jan Maximilian Michal's avatar Jan Maximilian Michal
Browse files

Finished an example test case for student page

parent 4cb4134e
No related branches found
No related tags found
2 merge requests!15Refactor,!13Student page
Pipeline #
import Vue from 'vue'
import Login from '@/components/Login'
describe('Login.vue', () => {
it('is doing nothing but ensure that we can test', () => {
data = {"submissions": [
{
"type": "Aufgabe 01",
"text": "Hallo, was geht denn da?",
"feedback": null,
"score": null,
"full_score": 12
}
]}
})
})
import Vue from 'vue'
import Login from '@/components/Login'
describe('Login.vue', () => {
it('is doing nothing but ensure that we can test', () => {
})
})
import Vue from 'vue'
import SubmissionList from '@/components/student/SubmissionList'
describe('SubmissionList.vue', () => {
it('tests the SubmissionList for students', () => {
const data = [{
'type': 'Aufgabe 01',
'text': 'I dont know the answer.',
'feedback': 'I am very disappointed.',
'score': 5,
'full_score': 14
},{
'type': 'Aufgabe 01',
'text': 'A very good solution, indeed',
'feedback': 'I am still very disappointed.',
'score': 7,
'full_score': 10
}]
const Constructor = Vue.extend(SubmissionList)
const comp = new Constructor({
propsData: {
// Props are passed in "propsData".
submissions: data
}
}).$mount()
expect(comp.sumScore)
.to.equal(12)
expect(comp.sumFullScore)
.to.equal(24)
expect(comp.pointRatio)
.to.equal('50.00')
})
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment