aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/miscRules.json
blob: 7ec4c3352cc3b34b129c087dd79a7b7271b0aae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * miscRules.json
 *
 * Simple rules for checking miscellaneous things.
 *
 */

{ 'name': "Misc"
, 'description': "Miscellaneous rules"
, 'rules': [
  //---------------------------------------------------------
  { 'name': "Footer check"
  , 'description': "Footer should appear on the page"
  , 'rule':
  function() {
    if ($5("div.footer").length === 0) {
      report('Footer does not appear', elt);
    }
  }
  },
  //---------------------------------------------------------
  { 'name': "Main content width check"
  , 'description': "Main content div should be between 520px and 1200px wide"
  , 'rule':
  function() {
    var width;
    var elt = $5("#content");
    if (elt) {
      width = elt.width();
      if (width > 1200) {
        report('Main content is too wide: ' + width, elt);
      } else if (width < 520) {
        report('Main content is too narrow: ' + width, elt);
      }
    }
  }
  }//,
  //---------------------------------------------------------
]
}