step1_test.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. require('controllers/wizard/step1_controller');
  20. /*
  21. describe('App.InstallerStep1Controller', function () {
  22. describe('#validateStep1()', function () {
  23. it('should return false and sets invalidClusterName to true if cluster name is empty', function () {
  24. var controller = App.InstallerStep1Controller.create();
  25. controller.set('clusterName', '');
  26. expect(controller.validateStep1()).to.equal(false);
  27. expect(controller.get('invalidClusterName')).to.equal(true);
  28. })
  29. it('should return false and sets invalidClusterName to true if cluster name has whitespaces', function () {
  30. var controller = App.InstallerStep1Controller.create();
  31. controller.set('clusterName', 'My Cluster');
  32. expect(controller.validateStep1()).to.equal(false);
  33. expect(controller.get('invalidClusterName')).to.equal(true);
  34. })
  35. it('should return false and sets invalidClusterName to true if cluster name has special characters', function () {
  36. var controller = App.InstallerStep1Controller.create();
  37. controller.set('clusterName', 'my-cluster');
  38. expect(controller.validateStep1()).to.equal(false);
  39. expect(controller.get('invalidClusterName')).to.equal(true);
  40. })
  41. it('should return true, sets invalidClusterName to false if cluster name is valid', function () {
  42. var controller = App.InstallerStep1Controller.create();
  43. var clusterName = 'mycluster1';
  44. controller.set('clusterName', clusterName);
  45. expect(controller.validateStep1()).to.equal(true);
  46. expect(controller.get('invalidClusterName')).to.equal(false);
  47. })
  48. })
  49. })*/