@trackunit/react-core-contexts-test 0.0.56 → 0.1.1

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.
@@ -1,6 +1,6 @@
1
1
  import { MockedResponse } from "@apollo/client/testing";
2
2
  import { RenderResult } from "@testing-library/react";
3
- import { ICurrentUserContext, IEnvironmentContext, IFeature, IGlobalSelectionContext, ITokenContext, UserSubscriptionPackageType } from "@trackunit/react-core-contexts-api";
3
+ import { IAssetSortingContext, ICurrentUserContext, IEnvironmentContext, IFeature, IGlobalSelectionContext, ITokenContext, UserSubscriptionPackageType } from "@trackunit/react-core-contexts-api";
4
4
  import * as React from "react";
5
5
  import { MemoryRouterProps } from "react-router-dom";
6
6
  /**
@@ -17,6 +17,7 @@ export declare class MockContextProviderBuilder {
17
17
  protected selectedRouterProps: MemoryRouterProps;
18
18
  protected selectedAssumedUser: ICurrentUserContext["assumedUser"];
19
19
  protected selectedGlobalSelection: IGlobalSelectionContext;
20
+ protected selectedAssetSortingContext: IAssetSortingContext;
20
21
  /**
21
22
  * Use this Environment Context.
22
23
  *
@@ -59,6 +60,12 @@ export declare class MockContextProviderBuilder {
59
60
  * @param globalSelection
60
61
  */
61
62
  globalSelection(globalSelection: IGlobalSelectionContext["selection"]): this;
63
+ /**
64
+ * Set global asset sorting context.
65
+ *
66
+ * @param overrides - Override the default context.
67
+ */
68
+ assetSorting(overrides: Partial<IAssetSortingContext>): this;
62
69
  renderHook<TProps, TResult>(callback: (props: TProps) => TResult, parentElement?: (children: React.ReactElement) => React.ReactElement): Promise<import("@testing-library/react-hooks/pure").RenderHookResult<TProps, TResult, import("@testing-library/react-hooks/pure").Renderer<TProps>>>;
63
70
  /**
64
71
  * Use this Manager Apollo Context Provider with the given mocks.
package/index2.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { act, render } from '@testing-library/react';
3
- import { UserSubscriptionPackageType } from '@trackunit/react-core-contexts-api';
4
- import { EnvironmentContextProvider, CurrentUserProvider, UserSubscriptionProvider, TokenProvider, ToastProvider, GlobalSelectionProvider } from '@trackunit/react-core-hooks';
3
+ import { AssetSortByProperty, SortOrder, UserSubscriptionPackageType } from '@trackunit/react-core-contexts-api';
4
+ import { EnvironmentContextProvider, CurrentUserProvider, UserSubscriptionProvider, TokenProvider, ToastProvider, GlobalSelectionProvider, AssetSortingProvider } from '@trackunit/react-core-hooks';
5
5
  import { tw } from '@trackunit/tailwind-styled-components';
6
6
  import { MemoryRouter } from 'react-router-dom';
7
7
  import { ApolloLink } from '@apollo/client';
@@ -1025,6 +1025,83 @@ var _export = function (options, source) {
1025
1025
  }
1026
1026
  };
1027
1027
 
1028
+ var internalObjectKeys = objectKeysInternal;
1029
+ var enumBugKeys = enumBugKeys$2;
1030
+
1031
+ // `Object.keys` method
1032
+ // https://tc39.es/ecma262/#sec-object.keys
1033
+ // eslint-disable-next-line es/no-object-keys -- safe
1034
+ var objectKeys$1 = Object.keys || function keys(O) {
1035
+ return internalObjectKeys(O, enumBugKeys);
1036
+ };
1037
+
1038
+ var DESCRIPTORS$1 = descriptors;
1039
+ var uncurryThis$4 = functionUncurryThis;
1040
+ var call$8 = functionCall;
1041
+ var fails$2 = fails$b;
1042
+ var objectKeys = objectKeys$1;
1043
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1044
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1045
+ var toObject = toObject$2;
1046
+ var IndexedObject = indexedObject;
1047
+
1048
+ // eslint-disable-next-line es/no-object-assign -- safe
1049
+ var $assign = Object.assign;
1050
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1051
+ var defineProperty$1 = Object.defineProperty;
1052
+ var concat = uncurryThis$4([].concat);
1053
+
1054
+ // `Object.assign` method
1055
+ // https://tc39.es/ecma262/#sec-object.assign
1056
+ var objectAssign = !$assign || fails$2(function () {
1057
+ // should have correct order of operations (Edge bug)
1058
+ if (DESCRIPTORS$1 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
1059
+ enumerable: true,
1060
+ get: function () {
1061
+ defineProperty$1(this, 'b', {
1062
+ value: 3,
1063
+ enumerable: false
1064
+ });
1065
+ }
1066
+ }), { b: 2 })).b !== 1) return true;
1067
+ // should work with symbols and should have deterministic property order (V8 bug)
1068
+ var A = {};
1069
+ var B = {};
1070
+ // eslint-disable-next-line es/no-symbol -- safe
1071
+ var symbol = Symbol();
1072
+ var alphabet = 'abcdefghijklmnopqrst';
1073
+ A[symbol] = 7;
1074
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1075
+ return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
1076
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1077
+ var T = toObject(target);
1078
+ var argumentsLength = arguments.length;
1079
+ var index = 1;
1080
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1081
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1082
+ while (argumentsLength > index) {
1083
+ var S = IndexedObject(arguments[index++]);
1084
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1085
+ var length = keys.length;
1086
+ var j = 0;
1087
+ var key;
1088
+ while (length > j) {
1089
+ key = keys[j++];
1090
+ if (!DESCRIPTORS$1 || call$8(propertyIsEnumerable, S, key)) T[key] = S[key];
1091
+ }
1092
+ } return T;
1093
+ } : $assign;
1094
+
1095
+ var $$6 = _export;
1096
+ var assign = objectAssign;
1097
+
1098
+ // `Object.assign` method
1099
+ // https://tc39.es/ecma262/#sec-object.assign
1100
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1101
+ $$6({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1102
+ assign: assign
1103
+ });
1104
+
1028
1105
  var classof$3 = classofRaw$2;
1029
1106
  var global$8 = global$i;
1030
1107
 
@@ -1042,7 +1119,7 @@ var aPossiblePrototype$1 = function (argument) {
1042
1119
 
1043
1120
  /* eslint-disable no-proto -- safe */
1044
1121
 
1045
- var uncurryThis$4 = functionUncurryThis;
1122
+ var uncurryThis$3 = functionUncurryThis;
1046
1123
  var anObject$5 = anObject$8;
1047
1124
  var aPossiblePrototype = aPossiblePrototype$1;
1048
1125
 
@@ -1056,7 +1133,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1056
1133
  var setter;
1057
1134
  try {
1058
1135
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1059
- setter = uncurryThis$4(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1136
+ setter = uncurryThis$3(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1060
1137
  setter(test, []);
1061
1138
  CORRECT_SETTER = test instanceof Array;
1062
1139
  } catch (error) { /* empty */ }
@@ -1069,7 +1146,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1069
1146
  };
1070
1147
  }() : undefined);
1071
1148
 
1072
- var defineProperty$1 = objectDefineProperty.f;
1149
+ var defineProperty = objectDefineProperty.f;
1073
1150
  var hasOwn$1 = hasOwnProperty_1;
1074
1151
  var wellKnownSymbol$8 = wellKnownSymbol$a;
1075
1152
 
@@ -1078,14 +1155,14 @@ var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1078
1155
  var setToStringTag$1 = function (target, TAG, STATIC) {
1079
1156
  if (target && !STATIC) target = target.prototype;
1080
1157
  if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
1081
- defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1158
+ defineProperty(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1082
1159
  }
1083
1160
  };
1084
1161
 
1085
1162
  var getBuiltIn$4 = getBuiltIn$8;
1086
1163
  var definePropertyModule = objectDefineProperty;
1087
1164
  var wellKnownSymbol$7 = wellKnownSymbol$a;
1088
- var DESCRIPTORS$1 = descriptors;
1165
+ var DESCRIPTORS = descriptors;
1089
1166
 
1090
1167
  var SPECIES$2 = wellKnownSymbol$7('species');
1091
1168
 
@@ -1093,7 +1170,7 @@ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1093
1170
  var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
1094
1171
  var defineProperty = definePropertyModule.f;
1095
1172
 
1096
- if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$2]) {
1173
+ if (DESCRIPTORS && Constructor && !Constructor[SPECIES$2]) {
1097
1174
  defineProperty(Constructor, SPECIES$2, {
1098
1175
  configurable: true,
1099
1176
  get: function () { return this; }
@@ -1149,8 +1226,8 @@ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1149
1226
  : (result = classofRaw(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1150
1227
  };
1151
1228
 
1152
- var uncurryThis$3 = functionUncurryThis;
1153
- var fails$2 = fails$b;
1229
+ var uncurryThis$2 = functionUncurryThis;
1230
+ var fails$1 = fails$b;
1154
1231
  var isCallable$4 = isCallable$h;
1155
1232
  var classof$1 = classof$2;
1156
1233
  var getBuiltIn$3 = getBuiltIn$8;
@@ -1160,7 +1237,7 @@ var noop = function () { /* empty */ };
1160
1237
  var empty = [];
1161
1238
  var construct = getBuiltIn$3('Reflect', 'construct');
1162
1239
  var constructorRegExp = /^\s*(?:class|function)\b/;
1163
- var exec = uncurryThis$3(constructorRegExp.exec);
1240
+ var exec = uncurryThis$2(constructorRegExp.exec);
1164
1241
  var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1165
1242
 
1166
1243
  var isConstructorModern = function isConstructor(argument) {
@@ -1194,7 +1271,7 @@ isConstructorLegacy.sham = true;
1194
1271
 
1195
1272
  // `IsConstructor` abstract operation
1196
1273
  // https://tc39.es/ecma262/#sec-isconstructor
1197
- var isConstructor$1 = !construct || fails$2(function () {
1274
+ var isConstructor$1 = !construct || fails$1(function () {
1198
1275
  var called;
1199
1276
  return isConstructorModern(isConstructorModern.call)
1200
1277
  || !isConstructorModern(Object)
@@ -1232,18 +1309,18 @@ var NATIVE_BIND$1 = functionBindNative;
1232
1309
 
1233
1310
  var FunctionPrototype = Function.prototype;
1234
1311
  var apply$1 = FunctionPrototype.apply;
1235
- var call$8 = FunctionPrototype.call;
1312
+ var call$7 = FunctionPrototype.call;
1236
1313
 
1237
1314
  // eslint-disable-next-line es/no-reflect -- safe
1238
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$8.bind(apply$1) : function () {
1239
- return call$8.apply(apply$1, arguments);
1315
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$1) : function () {
1316
+ return call$7.apply(apply$1, arguments);
1240
1317
  });
1241
1318
 
1242
- var uncurryThis$2 = functionUncurryThis;
1319
+ var uncurryThis$1 = functionUncurryThis;
1243
1320
  var aCallable$5 = aCallable$7;
1244
1321
  var NATIVE_BIND = functionBindNative;
1245
1322
 
1246
- var bind$4 = uncurryThis$2(uncurryThis$2.bind);
1323
+ var bind$4 = uncurryThis$1(uncurryThis$1.bind);
1247
1324
 
1248
1325
  // optional / simple context binding
1249
1326
  var functionBindContext = function (fn, that) {
@@ -1257,9 +1334,9 @@ var getBuiltIn$2 = getBuiltIn$8;
1257
1334
 
1258
1335
  var html$1 = getBuiltIn$2('document', 'documentElement');
1259
1336
 
1260
- var uncurryThis$1 = functionUncurryThis;
1337
+ var uncurryThis = functionUncurryThis;
1261
1338
 
1262
- var arraySlice$1 = uncurryThis$1([].slice);
1339
+ var arraySlice$1 = uncurryThis([].slice);
1263
1340
 
1264
1341
  var $TypeError$3 = TypeError;
1265
1342
 
@@ -1277,7 +1354,7 @@ var apply = functionApply;
1277
1354
  var bind$3 = functionBindContext;
1278
1355
  var isCallable$3 = isCallable$h;
1279
1356
  var hasOwn = hasOwnProperty_1;
1280
- var fails$1 = fails$b;
1357
+ var fails = fails$b;
1281
1358
  var html = html$1;
1282
1359
  var arraySlice = arraySlice$1;
1283
1360
  var createElement = documentCreateElement;
@@ -1364,7 +1441,7 @@ if (!set || !clear) {
1364
1441
  isCallable$3(global$7.postMessage) &&
1365
1442
  !global$7.importScripts &&
1366
1443
  $location && $location.protocol !== 'file:' &&
1367
- !fails$1(post)
1444
+ !fails(post)
1368
1445
  ) {
1369
1446
  defer = post;
1370
1447
  global$7.addEventListener('message', listener, false);
@@ -1608,10 +1685,10 @@ newPromiseCapability$2.f = function (C) {
1608
1685
  return new PromiseCapability(C);
1609
1686
  };
1610
1687
 
1611
- var $$6 = _export;
1688
+ var $$5 = _export;
1612
1689
  var IS_NODE = engineIsNode;
1613
1690
  var global$1 = global$i;
1614
- var call$7 = functionCall;
1691
+ var call$6 = functionCall;
1615
1692
  var defineBuiltIn$1 = defineBuiltIn$3;
1616
1693
  var setPrototypeOf = objectSetPrototypeOf;
1617
1694
  var setToStringTag = setToStringTag$1;
@@ -1689,7 +1766,7 @@ var callReaction = function (reaction, state) {
1689
1766
  if (result === reaction.promise) {
1690
1767
  reject(TypeError$1('Promise-chain cycle'));
1691
1768
  } else if (then = isThenable(result)) {
1692
- call$7(then, result, resolve, reject);
1769
+ call$6(then, result, resolve, reject);
1693
1770
  } else resolve(result);
1694
1771
  } else reject(value);
1695
1772
  } catch (error) {
@@ -1726,7 +1803,7 @@ var dispatchEvent = function (name, promise, reason) {
1726
1803
  };
1727
1804
 
1728
1805
  var onUnhandled = function (state) {
1729
- call$7(task, global$1, function () {
1806
+ call$6(task, global$1, function () {
1730
1807
  var promise = state.facade;
1731
1808
  var value = state.value;
1732
1809
  var IS_UNHANDLED = isUnhandled(state);
@@ -1749,7 +1826,7 @@ var isUnhandled = function (state) {
1749
1826
  };
1750
1827
 
1751
1828
  var onHandleUnhandled = function (state) {
1752
- call$7(task, global$1, function () {
1829
+ call$6(task, global$1, function () {
1753
1830
  var promise = state.facade;
1754
1831
  if (IS_NODE) {
1755
1832
  process$1.emit('rejectionHandled', promise);
@@ -1783,7 +1860,7 @@ var internalResolve = function (state, value, unwrap) {
1783
1860
  microtask(function () {
1784
1861
  var wrapper = { done: false };
1785
1862
  try {
1786
- call$7(then, value,
1863
+ call$6(then, value,
1787
1864
  bind$1(internalResolve, wrapper, state),
1788
1865
  bind$1(internalReject, wrapper, state)
1789
1866
  );
@@ -1807,7 +1884,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
1807
1884
  PromiseConstructor = function Promise(executor) {
1808
1885
  anInstance(this, PromisePrototype);
1809
1886
  aCallable$3(executor);
1810
- call$7(Internal, this);
1887
+ call$6(Internal, this);
1811
1888
  var state = getInternalPromiseState(this);
1812
1889
  try {
1813
1890
  executor(bind$1(internalResolve, state), bind$1(internalReject, state));
@@ -1870,7 +1947,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
1870
1947
  defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
1871
1948
  var that = this;
1872
1949
  return new PromiseConstructor(function (resolve, reject) {
1873
- call$7(nativeThen, that, resolve, reject);
1950
+ call$6(nativeThen, that, resolve, reject);
1874
1951
  }).then(onFulfilled, onRejected);
1875
1952
  // https://github.com/zloirock/core-js/issues/640
1876
1953
  }, { unsafe: true });
@@ -1888,7 +1965,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
1888
1965
  }
1889
1966
  }
1890
1967
 
1891
- $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
1968
+ $$5({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
1892
1969
  Promise: PromiseConstructor
1893
1970
  });
1894
1971
 
@@ -1922,7 +1999,7 @@ var getIteratorMethod$2 = function (it) {
1922
1999
  || Iterators[classof(it)];
1923
2000
  };
1924
2001
 
1925
- var call$6 = functionCall;
2002
+ var call$5 = functionCall;
1926
2003
  var aCallable$2 = aCallable$7;
1927
2004
  var anObject$3 = anObject$8;
1928
2005
  var tryToString$1 = tryToString$4;
@@ -1932,11 +2009,11 @@ var $TypeError$1 = TypeError;
1932
2009
 
1933
2010
  var getIterator$1 = function (argument, usingIterator) {
1934
2011
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
1935
- if (aCallable$2(iteratorMethod)) return anObject$3(call$6(iteratorMethod, argument));
2012
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
1936
2013
  throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
1937
2014
  };
1938
2015
 
1939
- var call$5 = functionCall;
2016
+ var call$4 = functionCall;
1940
2017
  var anObject$2 = anObject$8;
1941
2018
  var getMethod = getMethod$3;
1942
2019
 
@@ -1949,7 +2026,7 @@ var iteratorClose$1 = function (iterator, kind, value) {
1949
2026
  if (kind === 'throw') throw value;
1950
2027
  return value;
1951
2028
  }
1952
- innerResult = call$5(innerResult, iterator);
2029
+ innerResult = call$4(innerResult, iterator);
1953
2030
  } catch (error) {
1954
2031
  innerError = true;
1955
2032
  innerResult = error;
@@ -1961,7 +2038,7 @@ var iteratorClose$1 = function (iterator, kind, value) {
1961
2038
  };
1962
2039
 
1963
2040
  var bind = functionBindContext;
1964
- var call$4 = functionCall;
2041
+ var call$3 = functionCall;
1965
2042
  var anObject$1 = anObject$8;
1966
2043
  var tryToString = tryToString$4;
1967
2044
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
@@ -2019,7 +2096,7 @@ var iterate$2 = function (iterable, unboundFunction, options) {
2019
2096
  }
2020
2097
 
2021
2098
  next = IS_RECORD ? iterable.next : iterator.next;
2022
- while (!(step = call$4(next, iterator)).done) {
2099
+ while (!(step = call$3(next, iterator)).done) {
2023
2100
  try {
2024
2101
  result = callFn(step.value);
2025
2102
  } catch (error) {
@@ -2076,8 +2153,8 @@ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCor
2076
2153
  NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2077
2154
  });
2078
2155
 
2079
- var $$5 = _export;
2080
- var call$3 = functionCall;
2156
+ var $$4 = _export;
2157
+ var call$2 = functionCall;
2081
2158
  var aCallable$1 = aCallable$7;
2082
2159
  var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2083
2160
  var perform$1 = perform$3;
@@ -2086,7 +2163,7 @@ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2086
2163
 
2087
2164
  // `Promise.all` method
2088
2165
  // https://tc39.es/ecma262/#sec-promise.all
2089
- $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2166
+ $$4({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2090
2167
  all: function all(iterable) {
2091
2168
  var C = this;
2092
2169
  var capability = newPromiseCapabilityModule$2.f(C);
@@ -2101,7 +2178,7 @@ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2101
2178
  var index = counter++;
2102
2179
  var alreadyCalled = false;
2103
2180
  remaining++;
2104
- call$3($promiseResolve, C, promise).then(function (value) {
2181
+ call$2($promiseResolve, C, promise).then(function (value) {
2105
2182
  if (alreadyCalled) return;
2106
2183
  alreadyCalled = true;
2107
2184
  values[index] = value;
@@ -2115,7 +2192,7 @@ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2115
2192
  }
2116
2193
  });
2117
2194
 
2118
- var $$4 = _export;
2195
+ var $$3 = _export;
2119
2196
  var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2120
2197
  var NativePromiseConstructor = promiseNativeConstructor;
2121
2198
  var getBuiltIn$1 = getBuiltIn$8;
@@ -2126,7 +2203,7 @@ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructo
2126
2203
 
2127
2204
  // `Promise.prototype.catch` method
2128
2205
  // https://tc39.es/ecma262/#sec-promise.prototype.catch
2129
- $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2206
+ $$3({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2130
2207
  'catch': function (onRejected) {
2131
2208
  return this.then(undefined, onRejected);
2132
2209
  }
@@ -2140,8 +2217,8 @@ if (isCallable(NativePromiseConstructor)) {
2140
2217
  }
2141
2218
  }
2142
2219
 
2143
- var $$3 = _export;
2144
- var call$2 = functionCall;
2220
+ var $$2 = _export;
2221
+ var call$1 = functionCall;
2145
2222
  var aCallable = aCallable$7;
2146
2223
  var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2147
2224
  var perform = perform$3;
@@ -2150,7 +2227,7 @@ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2150
2227
 
2151
2228
  // `Promise.race` method
2152
2229
  // https://tc39.es/ecma262/#sec-promise.race
2153
- $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2230
+ $$2({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2154
2231
  race: function race(iterable) {
2155
2232
  var C = this;
2156
2233
  var capability = newPromiseCapabilityModule$1.f(C);
@@ -2158,7 +2235,7 @@ $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2158
2235
  var result = perform(function () {
2159
2236
  var $promiseResolve = aCallable(C.resolve);
2160
2237
  iterate(iterable, function (promise) {
2161
- call$2($promiseResolve, C, promise).then(capability.resolve, reject);
2238
+ call$1($promiseResolve, C, promise).then(capability.resolve, reject);
2162
2239
  });
2163
2240
  });
2164
2241
  if (result.error) reject(result.value);
@@ -2166,17 +2243,17 @@ $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2166
2243
  }
2167
2244
  });
2168
2245
 
2169
- var $$2 = _export;
2170
- var call$1 = functionCall;
2246
+ var $$1 = _export;
2247
+ var call = functionCall;
2171
2248
  var newPromiseCapabilityModule = newPromiseCapability$2;
2172
2249
  var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2173
2250
 
2174
2251
  // `Promise.reject` method
2175
2252
  // https://tc39.es/ecma262/#sec-promise.reject
2176
- $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2253
+ $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2177
2254
  reject: function reject(r) {
2178
2255
  var capability = newPromiseCapabilityModule.f(this);
2179
- call$1(capability.reject, undefined, r);
2256
+ call(capability.reject, undefined, r);
2180
2257
  return capability.promise;
2181
2258
  }
2182
2259
  });
@@ -2194,7 +2271,7 @@ var promiseResolve$1 = function (C, x) {
2194
2271
  return promiseCapability.promise;
2195
2272
  };
2196
2273
 
2197
- var $$1 = _export;
2274
+ var $ = _export;
2198
2275
  var getBuiltIn = getBuiltIn$8;
2199
2276
  var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2200
2277
  var promiseResolve = promiseResolve$1;
@@ -2203,89 +2280,12 @@ getBuiltIn('Promise');
2203
2280
 
2204
2281
  // `Promise.resolve` method
2205
2282
  // https://tc39.es/ecma262/#sec-promise.resolve
2206
- $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2283
+ $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2207
2284
  resolve: function resolve(x) {
2208
2285
  return promiseResolve(this, x);
2209
2286
  }
2210
2287
  });
2211
2288
 
2212
- var internalObjectKeys = objectKeysInternal;
2213
- var enumBugKeys = enumBugKeys$2;
2214
-
2215
- // `Object.keys` method
2216
- // https://tc39.es/ecma262/#sec-object.keys
2217
- // eslint-disable-next-line es/no-object-keys -- safe
2218
- var objectKeys$1 = Object.keys || function keys(O) {
2219
- return internalObjectKeys(O, enumBugKeys);
2220
- };
2221
-
2222
- var DESCRIPTORS = descriptors;
2223
- var uncurryThis = functionUncurryThis;
2224
- var call = functionCall;
2225
- var fails = fails$b;
2226
- var objectKeys = objectKeys$1;
2227
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2228
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2229
- var toObject = toObject$2;
2230
- var IndexedObject = indexedObject;
2231
-
2232
- // eslint-disable-next-line es/no-object-assign -- safe
2233
- var $assign = Object.assign;
2234
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2235
- var defineProperty = Object.defineProperty;
2236
- var concat = uncurryThis([].concat);
2237
-
2238
- // `Object.assign` method
2239
- // https://tc39.es/ecma262/#sec-object.assign
2240
- var objectAssign = !$assign || fails(function () {
2241
- // should have correct order of operations (Edge bug)
2242
- if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
2243
- enumerable: true,
2244
- get: function () {
2245
- defineProperty(this, 'b', {
2246
- value: 3,
2247
- enumerable: false
2248
- });
2249
- }
2250
- }), { b: 2 })).b !== 1) return true;
2251
- // should work with symbols and should have deterministic property order (V8 bug)
2252
- var A = {};
2253
- var B = {};
2254
- // eslint-disable-next-line es/no-symbol -- safe
2255
- var symbol = Symbol();
2256
- var alphabet = 'abcdefghijklmnopqrst';
2257
- A[symbol] = 7;
2258
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2259
- return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
2260
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2261
- var T = toObject(target);
2262
- var argumentsLength = arguments.length;
2263
- var index = 1;
2264
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2265
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
2266
- while (argumentsLength > index) {
2267
- var S = IndexedObject(arguments[index++]);
2268
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2269
- var length = keys.length;
2270
- var j = 0;
2271
- var key;
2272
- while (length > j) {
2273
- key = keys[j++];
2274
- if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
2275
- }
2276
- } return T;
2277
- } : $assign;
2278
-
2279
- var $ = _export;
2280
- var assign = objectAssign;
2281
-
2282
- // `Object.assign` method
2283
- // https://tc39.es/ecma262/#sec-object.assign
2284
- // eslint-disable-next-line es/no-object-assign -- required for testing
2285
- $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2286
- assign: assign
2287
- });
2288
-
2289
2289
  /******************************************************************************
2290
2290
  Copyright (c) Microsoft Corporation.
2291
2291
 
@@ -2371,6 +2371,19 @@ function ApolloMockedProviderWithError(props) {
2371
2371
  }));
2372
2372
  }
2373
2373
 
2374
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2375
+ const doNothing = () => {
2376
+ /* Do nothing */
2377
+ };
2378
+
2379
+ const mockAssetSortingContext = {
2380
+ setSortBy: doNothing,
2381
+ sortingState: {
2382
+ sortBy: AssetSortByProperty.Criticality,
2383
+ order: SortOrder.Desc
2384
+ }
2385
+ };
2386
+
2374
2387
  const mockCurrentUserContext = (overrides = {}) => Object.assign({
2375
2388
  userName: "",
2376
2389
  customerId: 12345,
@@ -2456,6 +2469,7 @@ class MockContextProviderBuilder {
2456
2469
  this.selectedGlobalSelection = {
2457
2470
  selection: null
2458
2471
  };
2472
+ this.selectedAssetSortingContext = mockAssetSortingContext;
2459
2473
  }
2460
2474
  /**
2461
2475
  * Use this Environment Context.
@@ -2549,6 +2563,17 @@ class MockContextProviderBuilder {
2549
2563
  };
2550
2564
  return this;
2551
2565
  }
2566
+ /**
2567
+ * Set global asset sorting context.
2568
+ *
2569
+ * @param overrides - Override the default context.
2570
+ */
2571
+
2572
+
2573
+ assetSorting(overrides) {
2574
+ this.selectedAssetSortingContext = Object.assign(Object.assign({}, mockAssetSortingContext), overrides);
2575
+ return this;
2576
+ }
2552
2577
 
2553
2578
  renderHook(callback, parentElement) {
2554
2579
  return __awaiter(this, void 0, void 0, function* () {
@@ -2635,17 +2660,21 @@ class MockContextProviderBuilder {
2635
2660
  children: jsx(GlobalSelectionProvider, Object.assign({
2636
2661
  value: this.selectedGlobalSelection
2637
2662
  }, {
2638
- children: jsx(ApolloMockedProviderWithError, Object.assign({
2639
- mocks: this.selectedApolloMocks,
2640
- addTypename: false
2663
+ children: jsx(AssetSortingProvider, Object.assign({
2664
+ value: this.selectedAssetSortingContext
2641
2665
  }, {
2642
- children: addTestRootContainer ? jsx(TestRoot, Object.assign({
2643
- "data-testid": "testRoot"
2666
+ children: jsx(ApolloMockedProviderWithError, Object.assign({
2667
+ mocks: this.selectedApolloMocks,
2668
+ addTypename: false
2644
2669
  }, {
2645
- children: testChildren
2646
- })) : jsx("div", {
2647
- children: testChildren
2648
- })
2670
+ children: addTestRootContainer ? jsx(TestRoot, Object.assign({
2671
+ "data-testid": "testRoot"
2672
+ }, {
2673
+ children: testChildren
2674
+ })) : jsx("div", {
2675
+ children: testChildren
2676
+ })
2677
+ }))
2649
2678
  }))
2650
2679
  }))
2651
2680
  }))
@@ -2666,11 +2695,6 @@ const TestRoot = tw.div(_t || (_t = _`
2666
2695
  inline-block;
2667
2696
  `));
2668
2697
 
2669
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2670
- const doNothing = () => {
2671
- /* Do nothing */
2672
- };
2673
-
2674
2698
  /**
2675
2699
  *
2676
2700
  * @param document Document that represents the specific GQL query / mutation schema.
@@ -0,0 +1,2 @@
1
+ import { IAssetSortingContext } from "@trackunit/react-core-contexts-api";
2
+ export declare const mockAssetSortingContext: IAssetSortingContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts-test",
3
- "version": "0.0.56",
3
+ "version": "0.1.1",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "module": "./index.js",
@@ -10,8 +10,8 @@
10
10
  "dependencies": {
11
11
  "@apollo/client": "3.6.9",
12
12
  "react": "17.0.2",
13
- "@trackunit/react-core-contexts-api": "0.1.1",
14
- "@trackunit/react-core-hooks": "0.1.3",
13
+ "@trackunit/react-core-contexts-api": "0.2.0",
14
+ "@trackunit/react-core-hooks": "0.2.1",
15
15
  "@trackunit/tailwind-styled-components": "0.0.49",
16
16
  "react-router-dom": "6.4.1",
17
17
  "graphql": "^15.8.0"