• 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/button/button.js
1
import template from './button.html';
2

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

6
  $ctrl.$onInit = () => {
10✔
7
    setButtonType(buildButtonType($ctrl.type));
10✔
8
    setCssClasses(buildCssClasses($ctrl.theme, $ctrl.block));
10✔
9
  };
10

11
  $ctrl.onButtonClick = () => {
10✔
12
    return $ctrl.onClick && $ctrl.onClick();
1✔
13
  };
14

15
  function buildButtonType(type){
16
    return ['submit', 'reset'].includes(type) ? type : 'button';
10✔
17
  }
18

19
  function setButtonType(buttonType){
20
    $ctrl.buttonType = buttonType;
10✔
21
  }
22

23
  function buildCssClasses(theme, block){
24
    const classes = ['pd-button'];
10✔
25
    if(isThemeValid(theme))
10✔
26
      classes.push(`pd-button-${theme}`);
2✔
27
    if(block)
10✔
28
      classes.push('pd-button-block');
1✔
29
    return classes.join(' ');
10✔
30
  }
31

32
  function isThemeValid(theme){
33
    return ['primary', 'secondary'].includes(theme);
10✔
34
  }
35

36
  function setCssClasses(cssClasses){
37
    $ctrl.cssClasses = cssClasses;
10✔
38
  }
39
}
40

41
export default {
42
  transclude: true,
43
  bindings: {
44
    theme: '@',
45
    type: '@',
46
    block: '<',
47
    disabled: '<',
48
    onClick: '='
49
  },
50
  controller,
51
  template
52
};
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