2
0

options.spec.js 865 B

1234567891011121314151617181920212223242526272829303132
  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. /* jshint node:true, jasmine:true */
  9. 'use strict';
  10. var options = require('../lib/options');
  11. describe('The policy options object', function() {
  12. it('should be immutable', function() {
  13. expect(function() {
  14. options.newProperty = '';
  15. }).toThrowError(/Attempted to assign to readonly property/);
  16. });
  17. it('should provide options for existing policies', function() {
  18. expect(function() {
  19. var value = options.asymmetric.keyPair.encryption;
  20. expect(value).toBeDefined();
  21. }).not.toThrow();
  22. expect(function() {
  23. var value = options.madeUpSection.subSection.ToMakeItCrash;
  24. expect(value).toBeDefined();
  25. }).toThrow();
  26. });
  27. });