@ukhomeoffice/cop-react-form-renderer 5.29.0 → 5.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CheckYourAnswers/CheckYourAnswers.js +2 -2
- package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +2 -2
- package/dist/components/CollectionPage/CollectionPage.js +2 -2
- package/dist/components/CollectionPage/CollectionPage.test.js +2 -2
- package/dist/components/CollectionSummary/BannerStrip.test.js +2 -2
- package/dist/components/CollectionSummary/CollectionSummary.js +4 -3
- package/dist/components/CollectionSummary/CollectionSummary.test.js +51 -2
- package/dist/components/CollectionSummary/Confirmation.js +4 -2
- package/dist/components/CollectionSummary/Confirmation.scss +1 -1
- package/dist/components/CollectionSummary/Confirmation.test.js +2 -2
- package/dist/components/CollectionSummary/SummaryCard.js +2 -2
- package/dist/components/CollectionSummary/SummaryCard.scss +4 -0
- package/dist/components/CollectionSummary/SummaryCard.test.js +2 -2
- package/dist/components/FormComponent/Collection.js +2 -2
- package/dist/components/FormComponent/FormComponent.js +4 -3
- package/dist/components/FormComponent/FormComponent.test.js +66 -34
- package/dist/components/FormPage/FormPage.js +2 -2
- package/dist/components/FormPage/FormPage.test.js +2 -2
- package/dist/components/FormRenderer/FormRenderer.js +9 -5
- package/dist/components/FormRenderer/FormRenderer.test.js +218 -133
- package/dist/components/FormRenderer/onCYAAction.js +20 -9
- package/dist/components/FormRenderer/onCYAAction.test.js +8 -1
- package/dist/components/FormRenderer/onPageAction.js +7 -2
- package/dist/components/FormRenderer/onPageAction.test.js +8 -1
- package/dist/components/PageActions/ActionButton.test.js +2 -2
- package/dist/components/SummaryList/GroupAction.js +2 -2
- package/dist/components/SummaryList/RowAction.js +2 -2
- package/dist/components/SummaryList/SummaryList.test.js +2 -2
- package/dist/components/TaskList/Task.js +2 -2
- package/dist/components/TaskList/TaskList.js +2 -2
- package/dist/components/TaskList/TaskList.test.js +2 -2
- package/dist/context/HooksContext/HooksContext.js +2 -2
- package/dist/context/HooksContext/HooksContext.test.js +2 -2
- package/dist/context/HooksContext/index.js +2 -2
- package/dist/context/ValidationContext/ValidationContext.js +2 -2
- package/dist/context/ValidationContext/ValidationContext.test.js +2 -2
- package/dist/context/ValidationContext/index.js +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/useRefData.js +2 -2
- package/dist/index.js +2 -2
- package/dist/utils/Component/cleanAttributes.test.js +2 -2
- package/dist/utils/Component/isEditable.test.js +2 -2
- package/dist/utils/Format/formatDataForComponent.test.js +2 -2
- package/dist/utils/Format/formatDataForPage.test.js +2 -2
- package/dist/utils/Validate/validateDate.test.js +2 -2
- package/dist/utils/Validate/validateMultifile.test.js +2 -2
- package/package.json +1 -1
|
@@ -18,8 +18,8 @@ var _userProfileData = _interopRequireDefault(require("../../json/userProfile.da
|
|
|
18
18
|
var _userProfile = _interopRequireDefault(require("../../json/userProfile.json"));
|
|
19
19
|
var _taskList = _interopRequireDefault(require("../../json/taskList.json"));
|
|
20
20
|
var _firstForm = _interopRequireDefault(require("../../json/firstForm.json"));
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
25
25
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -54,6 +54,11 @@ var setDate = function setDate(element, date) {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
|
+
var sleep = function sleep(ms) {
|
|
58
|
+
return new Promise(function (resolve) {
|
|
59
|
+
setTimeout(resolve, ms);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
57
62
|
describe('components', function () {
|
|
58
63
|
describe('FormRenderer', function () {
|
|
59
64
|
var mockAxios = new _axiosMockAdapter.default(_axios.default);
|
|
@@ -346,8 +351,8 @@ describe('components', function () {
|
|
|
346
351
|
}
|
|
347
352
|
}, _callee10);
|
|
348
353
|
})));
|
|
349
|
-
it('should handle page
|
|
350
|
-
var ON_PAGE_CHANGE_CALLS, ON_PAGE_CHANGE,
|
|
354
|
+
it('should handle a page submission once regardless of how many times page action is clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
355
|
+
var ON_PAGE_CHANGE_CALLS, ON_PAGE_CHANGE, ON_SUBMIT_CALLS, ON_SUBMIT, HOOKS, _container$childNodes, continueButtonGroup, continueFormButton, innerDiv, firstNameInput, EVENT, submitButton;
|
|
351
356
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
352
357
|
while (1) switch (_context12.prev = _context12.next) {
|
|
353
358
|
case 0:
|
|
@@ -355,13 +360,93 @@ describe('components', function () {
|
|
|
355
360
|
ON_PAGE_CHANGE = function ON_PAGE_CHANGE(pageId) {
|
|
356
361
|
ON_PAGE_CHANGE_CALLS.push(pageId);
|
|
357
362
|
};
|
|
363
|
+
ON_SUBMIT_CALLS = [];
|
|
364
|
+
ON_SUBMIT = /*#__PURE__*/function () {
|
|
365
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(type, payload, onSuccess, onError, fieldName, fieldValue) {
|
|
366
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
367
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
368
|
+
case 0:
|
|
369
|
+
ON_SUBMIT_CALLS.push({
|
|
370
|
+
type: type,
|
|
371
|
+
payload: payload,
|
|
372
|
+
onSuccess: onSuccess,
|
|
373
|
+
onError: onError,
|
|
374
|
+
fieldName: fieldName,
|
|
375
|
+
fieldValue: fieldValue
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// mock a delay when submitting to the backend
|
|
379
|
+
_context11.next = 3;
|
|
380
|
+
return sleep(2000);
|
|
381
|
+
case 3:
|
|
382
|
+
onSuccess();
|
|
383
|
+
case 4:
|
|
384
|
+
case "end":
|
|
385
|
+
return _context11.stop();
|
|
386
|
+
}
|
|
387
|
+
}, _callee11);
|
|
388
|
+
}));
|
|
389
|
+
return function ON_SUBMIT(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
390
|
+
return _ref12.apply(this, arguments);
|
|
391
|
+
};
|
|
392
|
+
}();
|
|
358
393
|
HOOKS = {
|
|
394
|
+
onSubmit: ON_SUBMIT,
|
|
359
395
|
onPageChange: ON_PAGE_CHANGE
|
|
360
396
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
397
|
+
(0, _testUtils.act)(function () {
|
|
398
|
+
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, _firstForm.default, {
|
|
399
|
+
hooks: HOOKS,
|
|
400
|
+
type: _models.FormTypes.CYA
|
|
401
|
+
})), container);
|
|
402
|
+
});
|
|
403
|
+
_container$childNodes = _slicedToArray(container.childNodes[0].childNodes[0].childNodes, 6), continueButtonGroup = _container$childNodes[5]; // go to first question page
|
|
404
|
+
continueFormButton = continueButtonGroup.childNodes[0];
|
|
405
|
+
_react.fireEvent.click(continueFormButton);
|
|
406
|
+
innerDiv = container.childNodes[0].childNodes[0]; // enter a value in the input field
|
|
407
|
+
firstNameInput = innerDiv.childNodes[1].childNodes[2];
|
|
408
|
+
EVENT = {
|
|
409
|
+
target: {
|
|
410
|
+
name: firstNameInput.id,
|
|
411
|
+
value: 'abc'
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
_react.fireEvent.change(firstNameInput, EVENT);
|
|
415
|
+
submitButton = innerDiv.childNodes[2].childNodes[0]; // click on save and continue
|
|
416
|
+
_react.fireEvent.click(submitButton);
|
|
417
|
+
|
|
418
|
+
// click on save and continue again
|
|
419
|
+
_react.fireEvent.click(submitButton);
|
|
420
|
+
|
|
421
|
+
// click on save and continue a third time
|
|
422
|
+
_react.fireEvent.click(submitButton);
|
|
423
|
+
|
|
424
|
+
// only expect one submit call to be made
|
|
425
|
+
expect(ON_SUBMIT_CALLS.length).toEqual(1);
|
|
426
|
+
expect(ON_PAGE_CHANGE_CALLS.length).toEqual(1);
|
|
427
|
+
expect(ON_SUBMIT_CALLS[0].type).toEqual(_models.PageAction.TYPES.SAVE_AND_CONTINUE);
|
|
428
|
+
case 20:
|
|
429
|
+
case "end":
|
|
430
|
+
return _context12.stop();
|
|
431
|
+
}
|
|
432
|
+
}, _callee12);
|
|
433
|
+
})));
|
|
434
|
+
it('should handle page navigation', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
435
|
+
var ON_PAGE_CHANGE_CALLS, ON_PAGE_CHANGE, HOOKS, form, hub, _hub$childNodes4, lineManagerList, link, page, pageHeading, continueButton, newPageHeading;
|
|
436
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
437
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
438
|
+
case 0:
|
|
439
|
+
ON_PAGE_CHANGE_CALLS = [];
|
|
440
|
+
ON_PAGE_CHANGE = function ON_PAGE_CHANGE(pageId) {
|
|
441
|
+
ON_PAGE_CHANGE_CALLS.push(pageId);
|
|
442
|
+
};
|
|
443
|
+
HOOKS = {
|
|
444
|
+
onPageChange: ON_PAGE_CHANGE
|
|
445
|
+
};
|
|
446
|
+
_context14.next = 5;
|
|
447
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
448
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
449
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
365
450
|
case 0:
|
|
366
451
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, _userProfile.default, {
|
|
367
452
|
data: _userProfileData.default,
|
|
@@ -369,9 +454,9 @@ describe('components', function () {
|
|
|
369
454
|
})), container);
|
|
370
455
|
case 1:
|
|
371
456
|
case "end":
|
|
372
|
-
return
|
|
457
|
+
return _context13.stop();
|
|
373
458
|
}
|
|
374
|
-
},
|
|
459
|
+
}, _callee13);
|
|
375
460
|
})));
|
|
376
461
|
case 5:
|
|
377
462
|
form = checkForm(container); // Navigate to the "Add or change a line manager" page.
|
|
@@ -399,19 +484,19 @@ describe('components', function () {
|
|
|
399
484
|
expect(newPageHeading.textContent).toEqual(_userProfile.default.pages[5].title);
|
|
400
485
|
case 24:
|
|
401
486
|
case "end":
|
|
402
|
-
return
|
|
487
|
+
return _context14.stop();
|
|
403
488
|
}
|
|
404
|
-
},
|
|
489
|
+
}, _callee14);
|
|
405
490
|
})));
|
|
406
|
-
it('should show no title when hide_title is set to true', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
491
|
+
it('should show no title when hide_title is set to true', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
407
492
|
var form, hub;
|
|
408
|
-
return _regeneratorRuntime().wrap(function
|
|
409
|
-
while (1) switch (
|
|
493
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
494
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
410
495
|
case 0:
|
|
411
|
-
|
|
412
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
413
|
-
return _regeneratorRuntime().wrap(function
|
|
414
|
-
while (1) switch (
|
|
496
|
+
_context16.next = 2;
|
|
497
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
498
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
499
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
415
500
|
case 0:
|
|
416
501
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, _userProfile.default, {
|
|
417
502
|
data: _userProfileData.default,
|
|
@@ -419,9 +504,9 @@ describe('components', function () {
|
|
|
419
504
|
})), container);
|
|
420
505
|
case 1:
|
|
421
506
|
case "end":
|
|
422
|
-
return
|
|
507
|
+
return _context15.stop();
|
|
423
508
|
}
|
|
424
|
-
},
|
|
509
|
+
}, _callee15);
|
|
425
510
|
})));
|
|
426
511
|
case 2:
|
|
427
512
|
form = checkForm(container);
|
|
@@ -431,66 +516,66 @@ describe('components', function () {
|
|
|
431
516
|
expect(hub.classList).toContain(_CheckYourAnswers.DEFAULT_CLASS);
|
|
432
517
|
case 7:
|
|
433
518
|
case "end":
|
|
434
|
-
return
|
|
519
|
+
return _context16.stop();
|
|
435
520
|
}
|
|
436
|
-
},
|
|
521
|
+
}, _callee16);
|
|
437
522
|
})));
|
|
438
|
-
it('should render a task list', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
523
|
+
it('should render a task list', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
439
524
|
var taskList;
|
|
440
|
-
return _regeneratorRuntime().wrap(function
|
|
441
|
-
while (1) switch (
|
|
525
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
526
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
442
527
|
case 0:
|
|
443
|
-
|
|
444
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
445
|
-
return _regeneratorRuntime().wrap(function
|
|
446
|
-
while (1) switch (
|
|
528
|
+
_context18.next = 2;
|
|
529
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
530
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
531
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
447
532
|
case 0:
|
|
448
533
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _taskList.default), container);
|
|
449
534
|
case 1:
|
|
450
535
|
case "end":
|
|
451
|
-
return
|
|
536
|
+
return _context17.stop();
|
|
452
537
|
}
|
|
453
|
-
},
|
|
538
|
+
}, _callee17);
|
|
454
539
|
})));
|
|
455
540
|
case 2:
|
|
456
541
|
taskList = container.childNodes[0].childNodes[1];
|
|
457
542
|
expect(taskList.classList).toContain(_TaskList.DEFAULT_CLASS);
|
|
458
543
|
case 4:
|
|
459
544
|
case "end":
|
|
460
|
-
return
|
|
545
|
+
return _context18.stop();
|
|
461
546
|
}
|
|
462
|
-
},
|
|
547
|
+
}, _callee18);
|
|
463
548
|
})));
|
|
464
|
-
it('should render a cya page', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
549
|
+
it('should render a cya page', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
465
550
|
var cya;
|
|
466
|
-
return _regeneratorRuntime().wrap(function
|
|
467
|
-
while (1) switch (
|
|
551
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
552
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
468
553
|
case 0:
|
|
469
|
-
|
|
470
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
471
|
-
return _regeneratorRuntime().wrap(function
|
|
472
|
-
while (1) switch (
|
|
554
|
+
_context20.next = 2;
|
|
555
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
556
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
557
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
473
558
|
case 0:
|
|
474
559
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _firstForm.default), container);
|
|
475
560
|
case 1:
|
|
476
561
|
case "end":
|
|
477
|
-
return
|
|
562
|
+
return _context19.stop();
|
|
478
563
|
}
|
|
479
|
-
},
|
|
564
|
+
}, _callee19);
|
|
480
565
|
})));
|
|
481
566
|
case 2:
|
|
482
567
|
cya = container.childNodes[0];
|
|
483
568
|
expect(cya.classList).toContain('hods-form');
|
|
484
569
|
case 4:
|
|
485
570
|
case "end":
|
|
486
|
-
return
|
|
571
|
+
return _context20.stop();
|
|
487
572
|
}
|
|
488
|
-
},
|
|
573
|
+
}, _callee20);
|
|
489
574
|
})));
|
|
490
|
-
it('should load task list with notes', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
575
|
+
it('should load task list with notes', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
491
576
|
var ON_SUBMIT_CALLS, ON_SUBMIT, HOOKS, TASK_LIST_WITH_NOTES, taskList;
|
|
492
|
-
return _regeneratorRuntime().wrap(function
|
|
493
|
-
while (1) switch (
|
|
577
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
578
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
494
579
|
case 0:
|
|
495
580
|
ON_SUBMIT_CALLS = [];
|
|
496
581
|
ON_SUBMIT = function ON_SUBMIT(type, payload, onSuccess) {
|
|
@@ -510,10 +595,10 @@ describe('components', function () {
|
|
|
510
595
|
"value": "yes"
|
|
511
596
|
}]
|
|
512
597
|
};
|
|
513
|
-
|
|
514
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
515
|
-
return _regeneratorRuntime().wrap(function
|
|
516
|
-
while (1) switch (
|
|
598
|
+
_context22.next = 7;
|
|
599
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
600
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
601
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
517
602
|
case 0:
|
|
518
603
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, TASK_LIST_WITH_NOTES, {
|
|
519
604
|
data: _userProfileData.default,
|
|
@@ -521,9 +606,9 @@ describe('components', function () {
|
|
|
521
606
|
})), container);
|
|
522
607
|
case 1:
|
|
523
608
|
case "end":
|
|
524
|
-
return
|
|
609
|
+
return _context21.stop();
|
|
525
610
|
}
|
|
526
|
-
},
|
|
611
|
+
}, _callee21);
|
|
527
612
|
})));
|
|
528
613
|
case 7:
|
|
529
614
|
taskList = container.childNodes[0].childNodes[1];
|
|
@@ -531,14 +616,14 @@ describe('components', function () {
|
|
|
531
616
|
expect(taskList.childNodes[5].classList).toContain('govuk-textarea');
|
|
532
617
|
case 10:
|
|
533
618
|
case "end":
|
|
534
|
-
return
|
|
619
|
+
return _context22.stop();
|
|
535
620
|
}
|
|
536
|
-
},
|
|
621
|
+
}, _callee22);
|
|
537
622
|
})));
|
|
538
|
-
it('should not load task list with notes', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
623
|
+
it('should not load task list with notes', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
539
624
|
var ON_SUBMIT_CALLS, ON_SUBMIT, HOOKS, TASK_LIST_WITH_NOTES, taskList;
|
|
540
|
-
return _regeneratorRuntime().wrap(function
|
|
541
|
-
while (1) switch (
|
|
625
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
626
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
542
627
|
case 0:
|
|
543
628
|
ON_SUBMIT_CALLS = [];
|
|
544
629
|
ON_SUBMIT = function ON_SUBMIT(type, payload, onSuccess) {
|
|
@@ -558,10 +643,10 @@ describe('components', function () {
|
|
|
558
643
|
"value": undefined
|
|
559
644
|
}]
|
|
560
645
|
};
|
|
561
|
-
|
|
562
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
563
|
-
return _regeneratorRuntime().wrap(function
|
|
564
|
-
while (1) switch (
|
|
646
|
+
_context24.next = 7;
|
|
647
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
648
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
649
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
565
650
|
case 0:
|
|
566
651
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, TASK_LIST_WITH_NOTES, {
|
|
567
652
|
data: _userProfileData.default,
|
|
@@ -569,9 +654,9 @@ describe('components', function () {
|
|
|
569
654
|
})), container);
|
|
570
655
|
case 1:
|
|
571
656
|
case "end":
|
|
572
|
-
return
|
|
657
|
+
return _context23.stop();
|
|
573
658
|
}
|
|
574
|
-
},
|
|
659
|
+
}, _callee23);
|
|
575
660
|
})));
|
|
576
661
|
case 7:
|
|
577
662
|
taskList = container.childNodes[0].childNodes[1];
|
|
@@ -583,14 +668,14 @@ describe('components', function () {
|
|
|
583
668
|
expect(taskList.childNodes[5].classList).not.toContain('govuk-textarea');
|
|
584
669
|
case 11:
|
|
585
670
|
case "end":
|
|
586
|
-
return
|
|
671
|
+
return _context24.stop();
|
|
587
672
|
}
|
|
588
|
-
},
|
|
673
|
+
}, _callee24);
|
|
589
674
|
})));
|
|
590
|
-
it('should handle navigating between task list pages', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
675
|
+
it('should handle navigating between task list pages', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
591
676
|
var ON_SUBMIT_CALLS, ON_SUBMIT, HOOKS, taskList, firstTaskStatus, secondTaskStatus, firstTask, newPage, fieldset, continueButton, seaButton, cyaPageChange, modeChangeLink, changePage, airButton, cyaPage, finalSubmit;
|
|
592
|
-
return _regeneratorRuntime().wrap(function
|
|
593
|
-
while (1) switch (
|
|
677
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
678
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
594
679
|
case 0:
|
|
595
680
|
ON_SUBMIT_CALLS = [];
|
|
596
681
|
ON_SUBMIT = function ON_SUBMIT(type, payload, onSuccess) {
|
|
@@ -600,19 +685,19 @@ describe('components', function () {
|
|
|
600
685
|
HOOKS = {
|
|
601
686
|
onSubmit: ON_SUBMIT
|
|
602
687
|
};
|
|
603
|
-
|
|
604
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
605
|
-
return _regeneratorRuntime().wrap(function
|
|
606
|
-
while (1) switch (
|
|
688
|
+
_context26.next = 5;
|
|
689
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
690
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
691
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
607
692
|
case 0:
|
|
608
693
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, _taskList.default, {
|
|
609
694
|
hooks: HOOKS
|
|
610
695
|
})), container);
|
|
611
696
|
case 1:
|
|
612
697
|
case "end":
|
|
613
|
-
return
|
|
698
|
+
return _context25.stop();
|
|
614
699
|
}
|
|
615
|
-
},
|
|
700
|
+
}, _callee25);
|
|
616
701
|
})));
|
|
617
702
|
case 5:
|
|
618
703
|
taskList = container.childNodes[0].childNodes[1]; // Check statuses are correct
|
|
@@ -683,14 +768,14 @@ describe('components', function () {
|
|
|
683
768
|
expect(finalSubmit.formStatus.tasks['Date, location and mode details'].complete).toEqual(true);
|
|
684
769
|
case 53:
|
|
685
770
|
case "end":
|
|
686
|
-
return
|
|
771
|
+
return _context26.stop();
|
|
687
772
|
}
|
|
688
|
-
},
|
|
773
|
+
}, _callee26);
|
|
689
774
|
})));
|
|
690
|
-
it('should go straight to CYA page if a complete task is selected', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
775
|
+
it('should go straight to CYA page if a complete task is selected', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
691
776
|
var ON_SUBMIT, HOOKS, taskList, newPage, fieldset;
|
|
692
|
-
return _regeneratorRuntime().wrap(function
|
|
693
|
-
while (1) switch (
|
|
777
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
778
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
694
779
|
case 0:
|
|
695
780
|
ON_SUBMIT = function ON_SUBMIT(type, payload, onSuccess) {
|
|
696
781
|
onSuccess();
|
|
@@ -698,19 +783,19 @@ describe('components', function () {
|
|
|
698
783
|
HOOKS = {
|
|
699
784
|
onSubmit: ON_SUBMIT
|
|
700
785
|
};
|
|
701
|
-
|
|
702
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
703
|
-
return _regeneratorRuntime().wrap(function
|
|
704
|
-
while (1) switch (
|
|
786
|
+
_context28.next = 4;
|
|
787
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
|
|
788
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
789
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
705
790
|
case 0:
|
|
706
791
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, _taskList.default, {
|
|
707
792
|
hooks: HOOKS
|
|
708
793
|
})), container);
|
|
709
794
|
case 1:
|
|
710
795
|
case "end":
|
|
711
|
-
return
|
|
796
|
+
return _context27.stop();
|
|
712
797
|
}
|
|
713
|
-
},
|
|
798
|
+
}, _callee27);
|
|
714
799
|
})));
|
|
715
800
|
case 4:
|
|
716
801
|
taskList = container.childNodes[0].childNodes[1]; // Launch first task
|
|
@@ -739,14 +824,14 @@ describe('components', function () {
|
|
|
739
824
|
expect(container.childNodes[0].childNodes[0].childNodes[0].textContent).toEqual('Check your answers');
|
|
740
825
|
case 16:
|
|
741
826
|
case "end":
|
|
742
|
-
return
|
|
827
|
+
return _context28.stop();
|
|
743
828
|
}
|
|
744
|
-
},
|
|
829
|
+
}, _callee28);
|
|
745
830
|
})));
|
|
746
|
-
it('should go to incomplete page when selecting in-progress task', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
831
|
+
it('should go to incomplete page when selecting in-progress task', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
747
832
|
var ON_SUBMIT, HOOKS, DATA, taskList;
|
|
748
|
-
return _regeneratorRuntime().wrap(function
|
|
749
|
-
while (1) switch (
|
|
833
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
834
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
750
835
|
case 0:
|
|
751
836
|
ON_SUBMIT = function ON_SUBMIT(type, payload, onSuccess) {
|
|
752
837
|
onSuccess();
|
|
@@ -766,10 +851,10 @@ describe('components', function () {
|
|
|
766
851
|
"taskPage": "eventMode"
|
|
767
852
|
}
|
|
768
853
|
};
|
|
769
|
-
|
|
770
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
771
|
-
return _regeneratorRuntime().wrap(function
|
|
772
|
-
while (1) switch (
|
|
854
|
+
_context30.next = 5;
|
|
855
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
856
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
857
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
773
858
|
case 0:
|
|
774
859
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, _taskList.default, {
|
|
775
860
|
hooks: HOOKS,
|
|
@@ -777,9 +862,9 @@ describe('components', function () {
|
|
|
777
862
|
})), container);
|
|
778
863
|
case 1:
|
|
779
864
|
case "end":
|
|
780
|
-
return
|
|
865
|
+
return _context29.stop();
|
|
781
866
|
}
|
|
782
|
-
},
|
|
867
|
+
}, _callee29);
|
|
783
868
|
})));
|
|
784
869
|
case 5:
|
|
785
870
|
taskList = container.childNodes[0].childNodes[1]; // Launch first task
|
|
@@ -789,14 +874,14 @@ describe('components', function () {
|
|
|
789
874
|
expect(container.childNodes[0].childNodes[0].childNodes[0].textContent).toEqual('Event Mode');
|
|
790
875
|
case 8:
|
|
791
876
|
case "end":
|
|
792
|
-
return
|
|
877
|
+
return _context30.stop();
|
|
793
878
|
}
|
|
794
|
-
},
|
|
879
|
+
}, _callee30);
|
|
795
880
|
})));
|
|
796
|
-
it('should go to the first page of a complete task if noTaskCYAs specified', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
881
|
+
it('should go to the first page of a complete task if noTaskCYAs specified', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
|
|
797
882
|
var ON_SUBMIT, HOOKS, TASK_LIST_WITH_NO_TASK_CYAS, taskList, newPage, fieldset;
|
|
798
|
-
return _regeneratorRuntime().wrap(function
|
|
799
|
-
while (1) switch (
|
|
883
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
884
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
800
885
|
case 0:
|
|
801
886
|
ON_SUBMIT = function ON_SUBMIT(type, payload, onSuccess) {
|
|
802
887
|
onSuccess();
|
|
@@ -810,19 +895,19 @@ describe('components', function () {
|
|
|
810
895
|
type: 'save',
|
|
811
896
|
complete: true
|
|
812
897
|
};
|
|
813
|
-
|
|
814
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
815
|
-
return _regeneratorRuntime().wrap(function
|
|
816
|
-
while (1) switch (
|
|
898
|
+
_context32.next = 7;
|
|
899
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
900
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
901
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
817
902
|
case 0:
|
|
818
903
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, TASK_LIST_WITH_NO_TASK_CYAS, {
|
|
819
904
|
hooks: HOOKS
|
|
820
905
|
})), container);
|
|
821
906
|
case 1:
|
|
822
907
|
case "end":
|
|
823
|
-
return
|
|
908
|
+
return _context31.stop();
|
|
824
909
|
}
|
|
825
|
-
},
|
|
910
|
+
}, _callee31);
|
|
826
911
|
})));
|
|
827
912
|
case 7:
|
|
828
913
|
taskList = container.childNodes[0].childNodes[1]; // Launch first task
|
|
@@ -847,14 +932,14 @@ describe('components', function () {
|
|
|
847
932
|
expect(container.childNodes[0].childNodes[0].childNodes[0].textContent).toEqual('Event Date');
|
|
848
933
|
case 18:
|
|
849
934
|
case "end":
|
|
850
|
-
return
|
|
935
|
+
return _context32.stop();
|
|
851
936
|
}
|
|
852
|
-
},
|
|
937
|
+
}, _callee32);
|
|
853
938
|
})));
|
|
854
|
-
it('should handle cancellation from a page', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
939
|
+
it('should handle cancellation from a page', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
855
940
|
var ON_CANCEL_CALLS, ON_CANCEL, HOOKS, form, hub, _hub$childNodes5, civilServantList, link, page, cancel;
|
|
856
|
-
return _regeneratorRuntime().wrap(function
|
|
857
|
-
while (1) switch (
|
|
941
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
942
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
858
943
|
case 0:
|
|
859
944
|
ON_CANCEL_CALLS = [];
|
|
860
945
|
ON_CANCEL = function ON_CANCEL() {
|
|
@@ -863,10 +948,10 @@ describe('components', function () {
|
|
|
863
948
|
HOOKS = {
|
|
864
949
|
onCancel: ON_CANCEL
|
|
865
950
|
};
|
|
866
|
-
|
|
867
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
868
|
-
return _regeneratorRuntime().wrap(function
|
|
869
|
-
while (1) switch (
|
|
951
|
+
_context34.next = 5;
|
|
952
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
|
|
953
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
954
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
870
955
|
case 0:
|
|
871
956
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, _userProfile.default, {
|
|
872
957
|
data: _userProfileData.default,
|
|
@@ -874,9 +959,9 @@ describe('components', function () {
|
|
|
874
959
|
})), container);
|
|
875
960
|
case 1:
|
|
876
961
|
case "end":
|
|
877
|
-
return
|
|
962
|
+
return _context33.stop();
|
|
878
963
|
}
|
|
879
|
-
},
|
|
964
|
+
}, _callee33);
|
|
880
965
|
})));
|
|
881
966
|
case 5:
|
|
882
967
|
form = checkForm(container); // Navigate to the "Are you a civil servant?" page.
|
|
@@ -893,14 +978,14 @@ describe('components', function () {
|
|
|
893
978
|
expect(ON_CANCEL_CALLS.length).toEqual(1);
|
|
894
979
|
case 15:
|
|
895
980
|
case "end":
|
|
896
|
-
return
|
|
981
|
+
return _context34.stop();
|
|
897
982
|
}
|
|
898
|
-
},
|
|
983
|
+
}, _callee34);
|
|
899
984
|
})));
|
|
900
|
-
it('should navigate to a specific page at the beginning of a task if it is set as the firstPage of a task', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
985
|
+
it('should navigate to a specific page at the beginning of a task if it is set as the firstPage of a task', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
901
986
|
var ON_SUBMIT_CALLS, ON_SUBMIT, HOOKS, TASK_LIST_NON_SEQUENTIAL, taskList, firstTask, newPage;
|
|
902
|
-
return _regeneratorRuntime().wrap(function
|
|
903
|
-
while (1) switch (
|
|
987
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
988
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
904
989
|
case 0:
|
|
905
990
|
ON_SUBMIT_CALLS = [];
|
|
906
991
|
ON_SUBMIT = function ON_SUBMIT(type, payload, onSuccess) {
|
|
@@ -912,19 +997,19 @@ describe('components', function () {
|
|
|
912
997
|
};
|
|
913
998
|
TASK_LIST_NON_SEQUENTIAL = JSON.parse(JSON.stringify(_taskList.default));
|
|
914
999
|
TASK_LIST_NON_SEQUENTIAL.hub.nonSequential = true;
|
|
915
|
-
|
|
916
|
-
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
917
|
-
return _regeneratorRuntime().wrap(function
|
|
918
|
-
while (1) switch (
|
|
1000
|
+
_context36.next = 7;
|
|
1001
|
+
return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
1002
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
1003
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
919
1004
|
case 0:
|
|
920
1005
|
(0, _reactDom.render)( /*#__PURE__*/_react2.default.createElement(_FormRenderer.default, _extends({}, TASK_LIST_NON_SEQUENTIAL, {
|
|
921
1006
|
hooks: HOOKS
|
|
922
1007
|
})), container);
|
|
923
1008
|
case 1:
|
|
924
1009
|
case "end":
|
|
925
|
-
return
|
|
1010
|
+
return _context35.stop();
|
|
926
1011
|
}
|
|
927
|
-
},
|
|
1012
|
+
}, _callee35);
|
|
928
1013
|
})));
|
|
929
1014
|
case 7:
|
|
930
1015
|
taskList = container.childNodes[0].childNodes[1]; // Launch first task of second section
|
|
@@ -937,9 +1022,9 @@ describe('components', function () {
|
|
|
937
1022
|
expect(newPage.childNodes[0].textContent).toEqual('Surname');
|
|
938
1023
|
case 13:
|
|
939
1024
|
case "end":
|
|
940
|
-
return
|
|
1025
|
+
return _context36.stop();
|
|
941
1026
|
}
|
|
942
|
-
},
|
|
1027
|
+
}, _callee36);
|
|
943
1028
|
})));
|
|
944
1029
|
});
|
|
945
1030
|
});
|