@pingux/astro 2.163.1-alpha.2 → 2.163.1-alpha.4
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/lib/cjs/components/LinkSelectField/LinkSelectField.js +7 -3
- package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +20 -1
- package/lib/cjs/components/MenuItem/MenuItem.js +22 -13
- package/lib/cjs/components/MenuItem/MenuItem.styles.d.ts +1 -1
- package/lib/cjs/components/MenuItem/MenuItem.styles.js +1 -1
- package/lib/cjs/components/MenuItem/MenuItem.test.js +217 -194
- package/lib/cjs/components/MenuSection/MenuSection.js +2 -1
- package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.js +57 -33
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +4 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.d.ts +1 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +2 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/menu.d.ts +15 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/menu.js +20 -7
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +15 -2
- package/lib/cjs/styles/themeOverrides/onyxSideNav.d.ts +1 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.d.ts +1 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.js +1 -1
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +2 -0
- package/lib/cjs/styles/themes/astro/customProperties/index.js +3 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.js +1 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/index.js +3 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +34 -2
- package/lib/cjs/styles/themes/next-gen/variants/menu.d.ts +32 -2
- package/lib/cjs/styles/themes/next-gen/variants/menu.js +39 -9
- package/lib/cjs/styles/themes/next-gen/variants/popoverMenu.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/variants/popoverMenu.js +1 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +33 -2
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +1 -0
- package/lib/components/LinkSelectField/LinkSelectField.js +7 -3
- package/lib/components/LinkSelectField/LinkSelectField.stories.js +19 -0
- package/lib/components/MenuItem/MenuItem.js +25 -16
- package/lib/components/MenuItem/MenuItem.styles.js +1 -1
- package/lib/components/MenuItem/MenuItem.test.js +224 -201
- package/lib/components/MenuSection/MenuSection.js +2 -1
- package/lib/components/PopoverMenu/PopoverMenu.stories.js +57 -33
- package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +3 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/menu.js +20 -7
- package/lib/styles/themes/astro/customProperties/icons.js +1 -1
- package/lib/styles/themes/astro/customProperties/index.js +3 -1
- package/lib/styles/themes/next-gen/customProperties/icons.js +1 -1
- package/lib/styles/themes/next-gen/customProperties/index.js +3 -1
- package/lib/styles/themes/next-gen/variants/menu.js +38 -8
- package/lib/styles/themes/next-gen/variants/popoverMenu.js +1 -0
- package/lib/styles/themes/next-gen/variants/variants.js +2 -1
- package/lib/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["key"],
|
|
6
|
-
_excluded2 = ["key"];
|
|
7
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof _Symbol ? _Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return _Object$defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = _Object$create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = _Object$getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(l); function g(t) { var _context5; _forEachInstanceProperty(_context5 = ["next", "throw", "return"]).call(_context5, function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], _forEachInstanceProperty(t).call(t, w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = _Object$create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = _Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { var _context6; if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context6 = this.tryEntries).call(_context6, m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+_sliceInstanceProperty(e).call(e, 1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { 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 && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
8
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
9
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
10
|
-
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
11
1
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
12
2
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
13
3
|
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
|
@@ -15,13 +5,34 @@ import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
15
5
|
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
|
16
6
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
17
7
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
8
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
9
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
10
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
11
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
12
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
13
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
14
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
|
15
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
16
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
|
17
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
18
|
+
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context7 = ownKeys(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context8 = ownKeys(Object(t))).call(_context8, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof _Symbol ? _Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return _Object$defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = _Object$create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = _Object$getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(l); function g(t) { var _context5; _forEachInstanceProperty(_context5 = ["next", "throw", "return"]).call(_context5, function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], _forEachInstanceProperty(t).call(t, w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = _Object$create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = _Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { var _context6; if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context6 = this.tryEntries).call(_context6, m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+_sliceInstanceProperty(e).call(e, 1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { 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 && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
21
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
22
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
23
|
+
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
18
24
|
import React from 'react';
|
|
19
25
|
import userEvent from '@testing-library/user-event';
|
|
26
|
+
import { useGetTheme } from '../../hooks';
|
|
20
27
|
import { Item, Menu } from '../../index';
|
|
21
28
|
import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
|
22
|
-
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
23
29
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
24
30
|
var testId = 'testId';
|
|
31
|
+
var mockTheme = {
|
|
32
|
+
themeState: {
|
|
33
|
+
isOnyx: false
|
|
34
|
+
}
|
|
35
|
+
};
|
|
25
36
|
var defaultMenuItems = [{
|
|
26
37
|
key: 'MenuItem 1',
|
|
27
38
|
children: 'MenuItem 1',
|
|
@@ -51,208 +62,220 @@ var getComponent = function getComponent() {
|
|
|
51
62
|
_ref$renderFn = _ref.renderFn,
|
|
52
63
|
renderFn = _ref$renderFn === void 0 ? render : _ref$renderFn;
|
|
53
64
|
return renderFn(___EmotionJSX(Menu, _extends({}, defaultProps, props), _mapInstanceProperty(items).call(items, function (li) {
|
|
54
|
-
|
|
55
|
-
itemProps = _objectWithoutProperties(li, _excluded);
|
|
56
|
-
return ___EmotionJSX(Item, _extends({
|
|
57
|
-
key: key
|
|
58
|
-
}, itemProps, {
|
|
65
|
+
return ___EmotionJSX(Item, _extends({}, li, {
|
|
59
66
|
sx: {
|
|
60
67
|
backgroundColor: 'orange'
|
|
61
68
|
}
|
|
62
69
|
}));
|
|
63
70
|
})));
|
|
64
71
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var key = li.key,
|
|
71
|
-
itemProps = _objectWithoutProperties(li, _excluded2);
|
|
72
|
-
return ___EmotionJSX(Item, _extends({
|
|
73
|
-
key: key
|
|
74
|
-
}, itemProps, {
|
|
75
|
-
sx: {
|
|
76
|
-
backgroundColor: 'orange'
|
|
77
|
-
}
|
|
78
|
-
}));
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
72
|
+
jest.mock('../../hooks/useGetTheme', function () {
|
|
73
|
+
return {
|
|
74
|
+
__esModule: true,
|
|
75
|
+
"default": jest.fn()
|
|
76
|
+
};
|
|
81
77
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
expect(menu).toBeInTheDocument();
|
|
87
|
-
expect(menuItems).toHaveLength(menuItems.length);
|
|
88
|
-
_forEachInstanceProperty(menuItems).call(menuItems, function (item) {
|
|
89
|
-
return expect(item).toBeInTheDocument();
|
|
78
|
+
describe('MenuItem', function () {
|
|
79
|
+
beforeEach(function () {
|
|
80
|
+
jest.clearAllMocks();
|
|
81
|
+
useGetTheme.mockReturnValue(mockTheme);
|
|
90
82
|
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
expect(menuItem).not.toHaveFocus();
|
|
101
|
-
expect(menuItem).not.toHaveClass('is-focused');
|
|
102
|
-
_context.next = 7;
|
|
103
|
-
return userEvent.tab();
|
|
104
|
-
case 7:
|
|
105
|
-
expect(menuItem).toHaveFocus();
|
|
106
|
-
expect(menuItem).toHaveClass('is-focused');
|
|
107
|
-
case 9:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context.stop();
|
|
110
|
-
}
|
|
111
|
-
}, _callee);
|
|
112
|
-
})));
|
|
113
|
-
test('can arrow through menuItems', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
114
|
-
var itemText1, itemText2, menuItem1, menuItem2;
|
|
115
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
116
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
117
|
-
case 0:
|
|
118
|
-
getComponent();
|
|
119
|
-
itemText1 = defaultMenuItems[0].children;
|
|
120
|
-
itemText2 = defaultMenuItems[1].children;
|
|
121
|
-
menuItem1 = screen.getByText(itemText1);
|
|
122
|
-
menuItem2 = screen.getByText(itemText2);
|
|
123
|
-
expect(menuItem1).not.toHaveFocus();
|
|
124
|
-
expect(menuItem1).not.toHaveClass('is-focused');
|
|
125
|
-
_context2.next = 9;
|
|
126
|
-
return userEvent.tab();
|
|
127
|
-
case 9:
|
|
128
|
-
expect(menuItem1).toHaveFocus();
|
|
129
|
-
expect(menuItem1).toHaveClass('is-focused');
|
|
130
|
-
fireEvent.keyDown(menuItem1, {
|
|
131
|
-
key: 'ArrowDown',
|
|
132
|
-
code: 'ArrowDown'
|
|
133
|
-
});
|
|
134
|
-
expect(menuItem2).toHaveFocus();
|
|
135
|
-
expect(menuItem2).toHaveClass('is-focused');
|
|
136
|
-
case 14:
|
|
137
|
-
case "end":
|
|
138
|
-
return _context2.stop();
|
|
139
|
-
}
|
|
140
|
-
}, _callee2);
|
|
141
|
-
})));
|
|
142
|
-
test('hovering menuItems applies focus class and removes focus style on unhover with "isNotFocusedOnHover"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
143
|
-
var itemText1, menuItem1;
|
|
144
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
145
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
146
|
-
case 0:
|
|
147
|
-
getComponent({
|
|
148
|
-
isNotFocusedOnHover: true
|
|
149
|
-
});
|
|
150
|
-
itemText1 = defaultMenuItems[0].children;
|
|
151
|
-
menuItem1 = screen.getByText(itemText1);
|
|
152
|
-
expect(menuItem1).not.toHaveClass('is-focused');
|
|
153
|
-
_context3.next = 6;
|
|
154
|
-
return userEvent.hover(menuItem1);
|
|
155
|
-
case 6:
|
|
156
|
-
expect(menuItem1).toHaveClass('is-focused');
|
|
157
|
-
_context3.next = 9;
|
|
158
|
-
return userEvent.unhover(menuItem1);
|
|
159
|
-
case 9:
|
|
160
|
-
expect(menuItem1).not.toHaveClass('is-focused');
|
|
161
|
-
case 10:
|
|
162
|
-
case "end":
|
|
163
|
-
return _context3.stop();
|
|
164
|
-
}
|
|
165
|
-
}, _callee3);
|
|
166
|
-
})));
|
|
167
|
-
test('hovering menuItems applies focus class and leaves focus style on unhover', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
168
|
-
var itemText1, itemText2, menuItem1, menuItem2;
|
|
169
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
170
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
171
|
-
case 0:
|
|
172
|
-
getComponent();
|
|
173
|
-
itemText1 = defaultMenuItems[0].children;
|
|
174
|
-
itemText2 = defaultMenuItems[1].children;
|
|
175
|
-
menuItem1 = screen.getByText(itemText1);
|
|
176
|
-
menuItem2 = screen.getByText(itemText2);
|
|
177
|
-
expect(menuItem1).not.toHaveClass('is-focused');
|
|
178
|
-
expect(menuItem2).not.toHaveClass('is-focused');
|
|
179
|
-
_context4.next = 9;
|
|
180
|
-
return userEvent.hover(menuItem1);
|
|
181
|
-
case 9:
|
|
182
|
-
expect(menuItem1).toHaveClass('is-focused');
|
|
183
|
-
_context4.next = 12;
|
|
184
|
-
return userEvent.hover(menuItem2);
|
|
185
|
-
case 12:
|
|
186
|
-
expect(menuItem2).toHaveClass('is-focused');
|
|
187
|
-
_context4.next = 15;
|
|
188
|
-
return userEvent.unhover(menuItem2);
|
|
189
|
-
case 15:
|
|
190
|
-
expect(menuItem2).toHaveClass('is-focused');
|
|
191
|
-
case 16:
|
|
192
|
-
case "end":
|
|
193
|
-
return _context4.stop();
|
|
194
|
-
}
|
|
195
|
-
}, _callee4);
|
|
196
|
-
})));
|
|
197
|
-
test('disables item with isDisabled applied, does not disable without prop', function () {
|
|
198
|
-
getComponent({
|
|
199
|
-
disabledKeys: [defaultMenuItems[0].key]
|
|
83
|
+
test('renders menu with menu items', function () {
|
|
84
|
+
getComponent();
|
|
85
|
+
var menu = screen.getByRole('menu');
|
|
86
|
+
var menuItems = screen.getAllByRole('menuitem');
|
|
87
|
+
expect(menu).toBeInTheDocument();
|
|
88
|
+
expect(menuItems).toHaveLength(menuItems.length);
|
|
89
|
+
_forEachInstanceProperty(menuItems).call(menuItems, function (item) {
|
|
90
|
+
return expect(item).toBeInTheDocument();
|
|
91
|
+
});
|
|
200
92
|
});
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
93
|
+
test('applies focus when tabbed to', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
94
|
+
var itemText, menuItem;
|
|
95
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
96
|
+
while (1) switch (_context.prev = _context.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
getComponent();
|
|
99
|
+
itemText = defaultMenuItems[0].children;
|
|
100
|
+
menuItem = screen.getByText(itemText);
|
|
101
|
+
expect(menuItem).not.toHaveFocus();
|
|
102
|
+
expect(menuItem).not.toHaveClass('is-focused');
|
|
103
|
+
_context.next = 7;
|
|
104
|
+
return userEvent.tab();
|
|
105
|
+
case 7:
|
|
106
|
+
expect(menuItem).toHaveFocus();
|
|
107
|
+
expect(menuItem).toHaveClass('is-focused');
|
|
108
|
+
case 9:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context.stop();
|
|
111
|
+
}
|
|
112
|
+
}, _callee);
|
|
113
|
+
})));
|
|
114
|
+
test('can arrow through menuItems', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
115
|
+
var itemText1, itemText2, menuItem1, menuItem2;
|
|
116
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
117
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
118
|
+
case 0:
|
|
119
|
+
getComponent();
|
|
120
|
+
itemText1 = defaultMenuItems[0].children;
|
|
121
|
+
itemText2 = defaultMenuItems[1].children;
|
|
122
|
+
menuItem1 = screen.getByText(itemText1);
|
|
123
|
+
menuItem2 = screen.getByText(itemText2);
|
|
124
|
+
expect(menuItem1).not.toHaveFocus();
|
|
125
|
+
expect(menuItem1).not.toHaveClass('is-focused');
|
|
126
|
+
_context2.next = 9;
|
|
127
|
+
return userEvent.tab();
|
|
128
|
+
case 9:
|
|
129
|
+
expect(menuItem1).toHaveFocus();
|
|
130
|
+
expect(menuItem1).toHaveClass('is-focused');
|
|
131
|
+
fireEvent.keyDown(menuItem1, {
|
|
132
|
+
key: 'ArrowDown',
|
|
133
|
+
code: 'ArrowDown'
|
|
134
|
+
});
|
|
135
|
+
expect(menuItem2).toHaveFocus();
|
|
136
|
+
expect(menuItem2).toHaveClass('is-focused');
|
|
137
|
+
case 14:
|
|
138
|
+
case "end":
|
|
139
|
+
return _context2.stop();
|
|
140
|
+
}
|
|
141
|
+
}, _callee2);
|
|
142
|
+
})));
|
|
143
|
+
test('hovering menuItems applies hover class and removes hover style on unhover with "isNotFocusedOnHover"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
144
|
+
var itemText1, menuItem1;
|
|
145
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
146
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
147
|
+
case 0:
|
|
148
|
+
getComponent({
|
|
149
|
+
isNotFocusedOnHover: true
|
|
150
|
+
});
|
|
151
|
+
itemText1 = defaultMenuItems[0].children;
|
|
152
|
+
menuItem1 = screen.getByText(itemText1);
|
|
153
|
+
expect(menuItem1).not.toHaveClass('is-hovered');
|
|
154
|
+
_context3.next = 6;
|
|
155
|
+
return userEvent.hover(menuItem1);
|
|
156
|
+
case 6:
|
|
157
|
+
expect(menuItem1).toHaveClass('is-hovered');
|
|
158
|
+
_context3.next = 9;
|
|
159
|
+
return userEvent.unhover(menuItem1);
|
|
160
|
+
case 9:
|
|
161
|
+
expect(menuItem1).not.toHaveClass('is-hovered');
|
|
162
|
+
case 10:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context3.stop();
|
|
165
|
+
}
|
|
166
|
+
}, _callee3);
|
|
167
|
+
})));
|
|
168
|
+
test('hovering menuItems applies hover class and leaves hover style on unhover', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
169
|
+
var itemText1, itemText2, menuItem1, menuItem2;
|
|
170
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
171
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
172
|
+
case 0:
|
|
173
|
+
getComponent();
|
|
174
|
+
itemText1 = defaultMenuItems[0].children;
|
|
175
|
+
itemText2 = defaultMenuItems[1].children;
|
|
176
|
+
menuItem1 = screen.getByText(itemText1);
|
|
177
|
+
menuItem2 = screen.getByText(itemText2);
|
|
178
|
+
expect(menuItem1).not.toHaveClass('is-hovered');
|
|
179
|
+
expect(menuItem2).not.toHaveClass('is-hovered');
|
|
180
|
+
_context4.next = 9;
|
|
181
|
+
return userEvent.hover(menuItem1);
|
|
182
|
+
case 9:
|
|
183
|
+
expect(menuItem1).toHaveClass('is-hovered');
|
|
184
|
+
_context4.next = 12;
|
|
185
|
+
return userEvent.hover(menuItem2);
|
|
186
|
+
case 12:
|
|
187
|
+
expect(menuItem2).toHaveClass('is-hovered');
|
|
188
|
+
_context4.next = 15;
|
|
189
|
+
return userEvent.unhover(menuItem2);
|
|
190
|
+
case 15:
|
|
191
|
+
expect(menuItem2).not.toHaveClass('is-hovered');
|
|
192
|
+
case 16:
|
|
193
|
+
case "end":
|
|
194
|
+
return _context4.stop();
|
|
195
|
+
}
|
|
196
|
+
}, _callee4);
|
|
197
|
+
})));
|
|
198
|
+
test('disables item with isDisabled applied, does not disable without prop', function () {
|
|
199
|
+
getComponent({
|
|
200
|
+
disabledKeys: [defaultMenuItems[0].key]
|
|
201
|
+
});
|
|
202
|
+
var disbaledItemText = defaultMenuItems[0].children;
|
|
203
|
+
var disabledMenuItem = screen.getByText(disbaledItemText);
|
|
204
|
+
expect(disabledMenuItem).toHaveClass('is-disabled');
|
|
205
|
+
var menuItemText = defaultMenuItems[1].children;
|
|
206
|
+
var menuItem = screen.getByText(menuItemText);
|
|
207
|
+
expect(menuItem).not.toHaveClass('is-disabled');
|
|
213
208
|
});
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
209
|
+
test('should change styles according to isPressed prop', function () {
|
|
210
|
+
var customItems = _Array$from(defaultMenuItems);
|
|
211
|
+
customItems[0].isPressed = true;
|
|
212
|
+
getComponent({}, {
|
|
213
|
+
items: customItems
|
|
214
|
+
});
|
|
215
|
+
var pressedItem = screen.getAllByRole('menuitem')[0];
|
|
216
|
+
var regularItem = screen.getAllByRole('menuitem')[1];
|
|
217
|
+
expect(pressedItem).toHaveClass('is-pressed');
|
|
218
|
+
expect(regularItem).not.toHaveClass('is-pressed');
|
|
223
219
|
});
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
220
|
+
test('applies selected styling with isSelected prop, does not add class without prop', function () {
|
|
221
|
+
getComponent({
|
|
222
|
+
selectionMode: 'single',
|
|
223
|
+
defaultSelectedKeys: [defaultMenuItems[0].key]
|
|
224
|
+
});
|
|
225
|
+
var selectedItemText = defaultMenuItems[0].children;
|
|
226
|
+
var selectedMenuItem = screen.getByText(selectedItemText);
|
|
227
|
+
expect(selectedMenuItem).toHaveClass('is-selected');
|
|
228
|
+
var menuItemText = defaultMenuItems[1].children;
|
|
229
|
+
var menuItem = screen.getByText(menuItemText);
|
|
230
|
+
expect(menuItem).not.toHaveClass('is-selected');
|
|
231
|
+
});
|
|
232
|
+
test('Item accepts a data-id and the data-id can be found in the DOM', function () {
|
|
233
|
+
getComponent();
|
|
234
|
+
var menuItems = screen.queryAllByRole('menuitem');
|
|
235
|
+
expect(menuItems).toHaveLength(defaultMenuItems.length);
|
|
236
|
+
expect(menuItems[0]).toHaveAttribute('data-id', defaultMenuItems[0]['data-id']);
|
|
237
|
+
});
|
|
238
|
+
test('custom props are passed into menuItem', function () {
|
|
239
|
+
getComponent();
|
|
240
|
+
var itemText1 = defaultMenuItems[0].children;
|
|
241
|
+
var menuItem1 = screen.getByText(itemText1);
|
|
242
|
+
expect(menuItem1).toHaveStyleRule('background-color', 'orange');
|
|
243
|
+
});
|
|
244
|
+
test('Selection mode given as single', function () {
|
|
245
|
+
getComponent({
|
|
246
|
+
selectionMode: 'single',
|
|
247
|
+
defaultSelectedKeys: [defaultMenuItems[0].key]
|
|
248
|
+
});
|
|
249
|
+
var menuItems = screen.queryAllByRole('menuitemradio');
|
|
250
|
+
expect(menuItems).toHaveLength(defaultMenuItems.length);
|
|
251
|
+
});
|
|
252
|
+
test('Selection mode given as multiple', function () {
|
|
253
|
+
getComponent({
|
|
254
|
+
selectionMode: 'multiple',
|
|
255
|
+
defaultSelectedKeys: [defaultMenuItems[0].key]
|
|
256
|
+
});
|
|
257
|
+
var menuItems = screen.queryAllByRole('menuitemcheckbox');
|
|
258
|
+
expect(menuItems).toHaveLength(defaultMenuItems.length);
|
|
247
259
|
});
|
|
248
|
-
var menuItems = screen.queryAllByRole('menuitemradio');
|
|
249
|
-
expect(menuItems).toHaveLength(defaultMenuItems.length);
|
|
250
260
|
});
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
261
|
+
describe('MenuItem', function () {
|
|
262
|
+
beforeEach(function () {
|
|
263
|
+
jest.clearAllMocks();
|
|
264
|
+
useGetTheme.mockReturnValue(_objectSpread(_objectSpread({}, mockTheme), {}, {
|
|
265
|
+
themeState: {
|
|
266
|
+
isOnyx: true
|
|
267
|
+
}
|
|
268
|
+
}));
|
|
269
|
+
});
|
|
270
|
+
test('checkmark icon is shown when item is selected and theme is onyx', function () {
|
|
271
|
+
getComponent({
|
|
272
|
+
selectionMode: 'single',
|
|
273
|
+
defaultSelectedKeys: [defaultMenuItems[0].key]
|
|
274
|
+
});
|
|
275
|
+
var selectedItemText = defaultMenuItems[0].children;
|
|
276
|
+
var selectedMenuItem = screen.getByText(selectedItemText);
|
|
277
|
+
var checkIcon = screen.getByTitle('Check Icon');
|
|
278
|
+
expect(selectedMenuItem).toBeInTheDocument();
|
|
279
|
+
expect(checkIcon).toBeInTheDocument();
|
|
255
280
|
});
|
|
256
|
-
var menuItems = screen.queryAllByRole('menuitemcheckbox');
|
|
257
|
-
expect(menuItems).toHaveLength(defaultMenuItems.length);
|
|
258
281
|
});
|
|
@@ -32,7 +32,8 @@ var MenuSection = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
32
32
|
return ___EmotionJSX(React.Fragment, null, section.key !== state.collection.getFirstKey() && ___EmotionJSX(Separator, {
|
|
33
33
|
as: "li",
|
|
34
34
|
p: 0,
|
|
35
|
-
|
|
35
|
+
my: "sm",
|
|
36
|
+
mx: "0"
|
|
36
37
|
}), ___EmotionJSX(Box, _extends({
|
|
37
38
|
as: "li"
|
|
38
39
|
}, itemProps, {
|