• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

glorious-codes / glorious-pitsby-demo / 61661de0-c128-4dfd-91b2-2e820ab41a59

18 Nov 2023 09:40PM CUT coverage: 100.0%. Remained the same
61661de0-c128-4dfd-91b2-2e820ab41a59

push

circleci

rafaelcamargo
chore: update pitsby from 1.36.3 to 1.37.0

120 of 120 branches covered (100.0%)

Branch coverage included in aggregate %.

288 of 288 relevant lines covered (100.0%)

9.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/scripts/angular/components/input/input.js
1
import template from './input.html';
2

3
function controller($element){
4
  const $ctrl = this;
11✔
5

6
  $ctrl.$onInit = () => {
11✔
7
    setInputType(buildInputType($ctrl.type));
11✔
8
    handleInputBooleanAttribute('required', $ctrl.required);
11✔
9
    handleInputBooleanAttribute('disabled', $ctrl.disabled);
11✔
10
  };
11

12
  $ctrl.onInputChange = () => {
11✔
13
    const { name, value } = $element.find('input')[0];
1✔
14
    return $ctrl.onChange && $ctrl.onChange({ name, value });
1✔
15
  };
16

17
  function buildInputType(type){
18
    return isTypeValid(type) ? type : 'text';
11✔
19
  }
20

21
  function isTypeValid(type){
22
    return [
11✔
23
      'color',
24
      'date',
25
      'datetime-local',
26
      'email',
27
      'file',
28
      'hidden',
29
      'image',
30
      'month',
31
      'number',
32
      'password',
33
      'range',
34
      'search',
35
      'tel',
36
      'time',
37
      'url',
38
      'week'
39
    ].includes(type);
40
  }
41

42
  function handleInputBooleanAttribute(attrName, attrValue){
43
    if(attrValue)
22✔
44
      $element.find('input').attr(attrName, attrValue);
3✔
45
  }
46

47
  function setInputType(inputType){
48
    $ctrl.inputType = inputType;
11✔
49
  }
50
}
51

52
controller.$inject = ['$element'];
34✔
53

54
export default {
55
  bindings: {
56
    name: '@',
57
    type: '@',
58
    value: '=',
59
    required: '<',
60
    disabled: '<',
61
    onChange: '='
62
  },
63
  controller,
64
  template
65
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc