Skip to content

Instantly share code, notes, and snippets.

@alexanderfrankel
Last active December 28, 2015 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderfrankel/cda488aa75ef12ddcb5f to your computer and use it in GitHub Desktop.
Save alexanderfrankel/cda488aa75ef12ddcb5f to your computer and use it in GitHub Desktop.
testing-in-karma-initialization-test.js
describe('initialization', function() {
it('sets grades to default array of grades', function() {
expect($scope.grades).to.equal(["first", "second", "third"]);
});
it('sets selectedGrade to null', function() {
expect($scope.selectedGrade).to.be.null;
});
it('sets selectedStudents to empty array', function() {
expect($scope.selectedStudents).to.equal([]);
});
it('sets allStudents to the index of students returned from the server', function() {
expect($scope.allStudents).to.equal([{name: "alex", grade: "third"},
{name: "tom", grade: "second"},
{name: "silvio", grade: "first"}
]);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment