aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/layout/miscRules.json
diff options
context:
space:
mode:
Diffstat (limited to 'exampleData/ruleSets/layout/miscRules.json')
-rw-r--r--exampleData/ruleSets/layout/miscRules.json42
1 files changed, 42 insertions, 0 deletions
diff --git a/exampleData/ruleSets/layout/miscRules.json b/exampleData/ruleSets/layout/miscRules.json
new file mode 100644
index 0000000..f14877d
--- /dev/null
+++ b/exampleData/ruleSets/layout/miscRules.json
@@ -0,0 +1,42 @@
+/*
+ * miscRules.json
+ *
+ * Simple rules for checking miscellaneous things.
+ *
+ */
+
+{ 'name': 'Misc'
+, 'description': 'Miscellaneous rules'
+, 'rules': [
+ //---------------------------------------------------------
+ { 'id': 12081801
+ , 'name': 'Footer check'
+ , 'description': 'Footer should appear on the page'
+ , 'rule':
+ function() {
+ if ($5('div.footer').length === 0) {
+ report('Footer does not appear', elt);
+ }
+ }
+ },
+ //---------------------------------------------------------
+ { 'id': 12081802
+ , '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);
+ }
+ }
+ }
+ }//,
+ //---------------------------------------------------------
+]
+}