ballot-parser.spec.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2018 Scytl Secure Electronic Voting SA
  3. *
  4. * All rights reserved
  5. *
  6. * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
  7. */
  8. /* global _ */
  9. /* global OV */
  10. describe('Ballot parser api', function () {
  11. 'use strict';
  12. var response = require('./mocks/ballot.json');
  13. it('should parse a ballot', function () {
  14. expect(OV).toBeDefined();
  15. expect(response).toBeDefined();
  16. var ballot = OV.BallotParser.parseBallot(response.ballot);
  17. expect(ballot.correctnessIds).toEqual({
  18. 10009: ['11ea5166652f492180f819c7d804ba68'],
  19. 10037: ['11ea5166652f492180f819c7d804ba68'],
  20. 10039: ['11ea5166652f492180f819c7d804ba68'],
  21. 10069: ['11ea5166652f492180f819c7d804ba68'],
  22. 100003: ['11ea5166652f492180f819c7d804ba68'],
  23. 100019: ['11ea5166652f492180f819c7d804ba68'],
  24. 100103: ['11ea5166652f492180f819c7d804ba68'],
  25. 100109: ['11ea5166652f492180f819c7d804ba68'],
  26. 100129: ['11ea5166652f492180f819c7d804ba68'],
  27. 100153: ['11ea5166652f492180f819c7d804ba68'],
  28. 100169: ['11ea5166652f492180f819c7d804ba68'],
  29. 100183: ['11ea5166652f492180f819c7d804ba68'],
  30. 100193: ['11ea5166652f492180f819c7d804ba68'],
  31. 100207: ['11ea5166652f492180f819c7d804ba68'],
  32. 100237: ['11ea5166652f492180f819c7d804ba68'],
  33. 100267: ['11ea5166652f492180f819c7d804ba68'],
  34. 100297: ['11ea5166652f492180f819c7d804ba68'],
  35. 100343: ['11ea5166652f492180f819c7d804ba68'],
  36. 100363: ['11ea5166652f492180f819c7d804ba68'],
  37. 100379: ['11ea5166652f492180f819c7d804ba68'],
  38. 100393: ['11ea5166652f492180f819c7d804ba68'],
  39. 100417: ['11ea5166652f492180f819c7d804ba68'],
  40. 100523: ['11ea5166652f492180f819c7d804ba68'],
  41. 100549: ['11ea5166652f492180f819c7d804ba68'],
  42. 100559: ['11ea5166652f492180f819c7d804ba68'],
  43. 100613: ['11ea5166652f492180f819c7d804ba68'],
  44. 100673: ['11ea5166652f492180f819c7d804ba68'],
  45. 100693: ['11ea5166652f492180f819c7d804ba68'],
  46. 100699: ['11ea5166652f492180f819c7d804ba68'],
  47. 100703: ['11ea5166652f492180f819c7d804ba68'],
  48. 100733: ['11ea5166652f492180f819c7d804ba68'],
  49. 100741: ['11ea5166652f492180f819c7d804ba68'],
  50. 100747: ['11ea5166652f492180f819c7d804ba68'],
  51. 100769: ['11ea5166652f492180f819c7d804ba68'],
  52. 100787: ['11ea5166652f492180f819c7d804ba68'],
  53. 100799: ['11ea5166652f492180f819c7d804ba68'],
  54. 100823: ['11ea5166652f492180f819c7d804ba68']
  55. });
  56. });
  57. });