[Forms] Fill in specs

Fill in specs for scripts which support the mct-form
and mct-control directives. WTD-530.
This commit is contained in:
Victor Woeltjen
2014-11-28 15:33:40 -08:00
parent 29c5a7aaba
commit 1bfc21270b
5 changed files with 161 additions and 5 deletions

View File

@ -8,7 +8,8 @@ define(
function () {
"use strict";
var MATCH_ALL = /^.*$/;
// Default ng-pattern; any non whitespace
var NON_WHITESPACE = /\S/;
/**
* The mct-form directive allows generation of displayable
@ -37,8 +38,7 @@ define(
].join("/");
function controller($scope) {
var regexps = [],
matchAll = /.*/;
var regexps = [];
// ng-pattern seems to want a RegExp, and not a
// string (despite what documentation says) but
@ -47,7 +47,7 @@ define(
function getRegExp(pattern) {
// If undefined, don't apply a pattern
if (!pattern) {
return MATCH_ALL;
return NON_WHITESPACE;
}
// Just echo if it's already a regexp

View File

@ -1,8 +1,9 @@
/*global define*/
/*global define,moment*/
define(
["../../lib/moment.min"],
function () {
"use strict";
var DATE_FORMAT = "YYYY-DDD";