Set up comprehensive frontend testing infrastructure
- Install Jest for unit testing with React Testing Library - Install Playwright for end-to-end testing - Configure Jest with proper TypeScript support and module mapping - Create test setup files and utilities for both unit and e2e tests Components: * Jest configuration with coverage thresholds * Playwright configuration with browser automation * Unit tests for LoginForm, AuthContext, and useSocketIO hook * E2E tests for authentication, dashboard, and agents workflows * GitHub Actions workflow for automated testing * Mock data and API utilities for consistent testing * Test documentation with best practices Testing features: - Unit tests with 70% coverage threshold - E2E tests with API mocking and user journey testing - CI/CD integration for automated test runs - Cross-browser testing support with Playwright - Authentication system testing end-to-end 🚀 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
6
frontend/node_modules/pure-rand/lib/esm/distribution/GenerateN.js
generated
vendored
Normal file
6
frontend/node_modules/pure-rand/lib/esm/distribution/GenerateN.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { unsafeGenerateN } from './UnsafeGenerateN.js';
|
||||
export function generateN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
var out = unsafeGenerateN(nextRng, num);
|
||||
return [out, nextRng];
|
||||
}
|
||||
6
frontend/node_modules/pure-rand/lib/esm/distribution/SkipN.js
generated
vendored
Normal file
6
frontend/node_modules/pure-rand/lib/esm/distribution/SkipN.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { unsafeSkipN } from './UnsafeSkipN.js';
|
||||
export function skipN(rng, num) {
|
||||
var nextRng = rng.clone();
|
||||
unsafeSkipN(nextRng, num);
|
||||
return nextRng;
|
||||
}
|
||||
12
frontend/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js
generated
vendored
Normal file
12
frontend/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { unsafeUniformArrayIntDistribution } from './UnsafeUniformArrayIntDistribution.js';
|
||||
function uniformArrayIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
|
||||
}
|
||||
return function (rng) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
export { uniformArrayIntDistribution };
|
||||
12
frontend/node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js
generated
vendored
Normal file
12
frontend/node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { unsafeUniformBigIntDistribution } from './UnsafeUniformBigIntDistribution.js';
|
||||
function uniformBigIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformBigIntDistribution(from, to, nextRng), nextRng];
|
||||
}
|
||||
return function (rng) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformBigIntDistribution(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
export { uniformBigIntDistribution };
|
||||
12
frontend/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js
generated
vendored
Normal file
12
frontend/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { unsafeUniformIntDistribution } from './UnsafeUniformIntDistribution.js';
|
||||
function uniformIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
|
||||
}
|
||||
return function (rng) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
export { uniformIntDistribution };
|
||||
7
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeGenerateN.js
generated
vendored
Normal file
7
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeGenerateN.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export function unsafeGenerateN(rng, num) {
|
||||
var out = [];
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
out.push(rng.unsafeNext());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
5
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeSkipN.js
generated
vendored
Normal file
5
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeSkipN.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export function unsafeSkipN(rng, num) {
|
||||
for (var idx = 0; idx != num; ++idx) {
|
||||
rng.unsafeNext();
|
||||
}
|
||||
}
|
||||
8
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js
generated
vendored
Normal file
8
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { addArrayIntToNew, addOneToPositiveArrayInt, substractArrayIntToNew, trimArrayIntInplace, } from './internals/ArrayInt.js';
|
||||
import { unsafeUniformArrayIntDistributionInternal } from './internals/UnsafeUniformArrayIntDistributionInternal.js';
|
||||
export function unsafeUniformArrayIntDistribution(from, to, rng) {
|
||||
var rangeSize = trimArrayIntInplace(addOneToPositiveArrayInt(substractArrayIntToNew(to, from)));
|
||||
var emptyArrayIntData = rangeSize.data.slice(0);
|
||||
var g = unsafeUniformArrayIntDistributionInternal(emptyArrayIntData, rangeSize.data, rng);
|
||||
return trimArrayIntInplace(addArrayIntToNew({ sign: 1, data: g }, from));
|
||||
}
|
||||
33
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
Normal file
33
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
var SBigInt = typeof BigInt !== 'undefined' ? BigInt : undefined;
|
||||
var One = typeof BigInt !== 'undefined' ? BigInt(1) : undefined;
|
||||
var ThirtyTwo = typeof BigInt !== 'undefined' ? BigInt(32) : undefined;
|
||||
var NumValues = typeof BigInt !== 'undefined' ? BigInt(0x100000000) : undefined;
|
||||
export function unsafeUniformBigIntDistribution(from, to, rng) {
|
||||
var diff = to - from + One;
|
||||
var FinalNumValues = NumValues;
|
||||
var NumIterations = 1;
|
||||
while (FinalNumValues < diff) {
|
||||
FinalNumValues <<= ThirtyTwo;
|
||||
++NumIterations;
|
||||
}
|
||||
var value = generateNext(NumIterations, rng);
|
||||
if (value < diff) {
|
||||
return value + from;
|
||||
}
|
||||
if (value + diff < FinalNumValues) {
|
||||
return (value % diff) + from;
|
||||
}
|
||||
var MaxAcceptedRandom = FinalNumValues - (FinalNumValues % diff);
|
||||
while (value >= MaxAcceptedRandom) {
|
||||
value = generateNext(NumIterations, rng);
|
||||
}
|
||||
return (value % diff) + from;
|
||||
}
|
||||
function generateNext(NumIterations, rng) {
|
||||
var value = SBigInt(rng.unsafeNext() + 0x80000000);
|
||||
for (var num = 1; num < NumIterations; ++num) {
|
||||
var out = rng.unsafeNext();
|
||||
value = (value << ThirtyTwo) + SBigInt(out + 0x80000000);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
30
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js
generated
vendored
Normal file
30
frontend/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { unsafeUniformIntDistributionInternal } from './internals/UnsafeUniformIntDistributionInternal.js';
|
||||
import { fromNumberToArrayInt64, substractArrayInt64 } from './internals/ArrayInt64.js';
|
||||
import { unsafeUniformArrayIntDistributionInternal } from './internals/UnsafeUniformArrayIntDistributionInternal.js';
|
||||
var safeNumberMaxSafeInteger = Number.MAX_SAFE_INTEGER;
|
||||
var sharedA = { sign: 1, data: [0, 0] };
|
||||
var sharedB = { sign: 1, data: [0, 0] };
|
||||
var sharedC = { sign: 1, data: [0, 0] };
|
||||
var sharedData = [0, 0];
|
||||
function uniformLargeIntInternal(from, to, rangeSize, rng) {
|
||||
var rangeSizeArrayIntValue = rangeSize <= safeNumberMaxSafeInteger
|
||||
? fromNumberToArrayInt64(sharedC, rangeSize)
|
||||
: substractArrayInt64(sharedC, fromNumberToArrayInt64(sharedA, to), fromNumberToArrayInt64(sharedB, from));
|
||||
if (rangeSizeArrayIntValue.data[1] === 0xffffffff) {
|
||||
rangeSizeArrayIntValue.data[0] += 1;
|
||||
rangeSizeArrayIntValue.data[1] = 0;
|
||||
}
|
||||
else {
|
||||
rangeSizeArrayIntValue.data[1] += 1;
|
||||
}
|
||||
unsafeUniformArrayIntDistributionInternal(sharedData, rangeSizeArrayIntValue.data, rng);
|
||||
return sharedData[0] * 0x100000000 + sharedData[1] + from;
|
||||
}
|
||||
export function unsafeUniformIntDistribution(from, to, rng) {
|
||||
var rangeSize = to - from;
|
||||
if (rangeSize <= 0xffffffff) {
|
||||
var g = unsafeUniformIntDistributionInternal(rangeSize + 1, rng);
|
||||
return g + from;
|
||||
}
|
||||
return uniformLargeIntInternal(from, to, rangeSize, rng);
|
||||
}
|
||||
83
frontend/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js
generated
vendored
Normal file
83
frontend/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
export function addArrayIntToNew(arrayIntA, arrayIntB) {
|
||||
if (arrayIntA.sign !== arrayIntB.sign) {
|
||||
return substractArrayIntToNew(arrayIntA, { sign: -arrayIntB.sign, data: arrayIntB.data });
|
||||
}
|
||||
var data = [];
|
||||
var reminder = 0;
|
||||
var dataA = arrayIntA.data;
|
||||
var dataB = arrayIntB.data;
|
||||
for (var indexA = dataA.length - 1, indexB = dataB.length - 1; indexA >= 0 || indexB >= 0; --indexA, --indexB) {
|
||||
var vA = indexA >= 0 ? dataA[indexA] : 0;
|
||||
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
||||
var current = vA + vB + reminder;
|
||||
data.push(current >>> 0);
|
||||
reminder = ~~(current / 0x100000000);
|
||||
}
|
||||
if (reminder !== 0) {
|
||||
data.push(reminder);
|
||||
}
|
||||
return { sign: arrayIntA.sign, data: data.reverse() };
|
||||
}
|
||||
export function addOneToPositiveArrayInt(arrayInt) {
|
||||
arrayInt.sign = 1;
|
||||
var data = arrayInt.data;
|
||||
for (var index = data.length - 1; index >= 0; --index) {
|
||||
if (data[index] === 0xffffffff) {
|
||||
data[index] = 0;
|
||||
}
|
||||
else {
|
||||
data[index] += 1;
|
||||
return arrayInt;
|
||||
}
|
||||
}
|
||||
data.unshift(1);
|
||||
return arrayInt;
|
||||
}
|
||||
function isStrictlySmaller(dataA, dataB) {
|
||||
var maxLength = Math.max(dataA.length, dataB.length);
|
||||
for (var index = 0; index < maxLength; ++index) {
|
||||
var indexA = index + dataA.length - maxLength;
|
||||
var indexB = index + dataB.length - maxLength;
|
||||
var vA = indexA >= 0 ? dataA[indexA] : 0;
|
||||
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
||||
if (vA < vB)
|
||||
return true;
|
||||
if (vA > vB)
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export function substractArrayIntToNew(arrayIntA, arrayIntB) {
|
||||
if (arrayIntA.sign !== arrayIntB.sign) {
|
||||
return addArrayIntToNew(arrayIntA, { sign: -arrayIntB.sign, data: arrayIntB.data });
|
||||
}
|
||||
var dataA = arrayIntA.data;
|
||||
var dataB = arrayIntB.data;
|
||||
if (isStrictlySmaller(dataA, dataB)) {
|
||||
var out = substractArrayIntToNew(arrayIntB, arrayIntA);
|
||||
out.sign = -out.sign;
|
||||
return out;
|
||||
}
|
||||
var data = [];
|
||||
var reminder = 0;
|
||||
for (var indexA = dataA.length - 1, indexB = dataB.length - 1; indexA >= 0 || indexB >= 0; --indexA, --indexB) {
|
||||
var vA = indexA >= 0 ? dataA[indexA] : 0;
|
||||
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
||||
var current = vA - vB - reminder;
|
||||
data.push(current >>> 0);
|
||||
reminder = current < 0 ? 1 : 0;
|
||||
}
|
||||
return { sign: arrayIntA.sign, data: data.reverse() };
|
||||
}
|
||||
export function trimArrayIntInplace(arrayInt) {
|
||||
var data = arrayInt.data;
|
||||
var firstNonZero = 0;
|
||||
for (; firstNonZero !== data.length && data[firstNonZero] === 0; ++firstNonZero) { }
|
||||
if (firstNonZero === data.length) {
|
||||
arrayInt.sign = 1;
|
||||
arrayInt.data = [0];
|
||||
return arrayInt;
|
||||
}
|
||||
data.splice(0, firstNonZero);
|
||||
return arrayInt;
|
||||
}
|
||||
49
frontend/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt64.js
generated
vendored
Normal file
49
frontend/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt64.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
export function fromNumberToArrayInt64(out, n) {
|
||||
if (n < 0) {
|
||||
var posN = -n;
|
||||
out.sign = -1;
|
||||
out.data[0] = ~~(posN / 0x100000000);
|
||||
out.data[1] = posN >>> 0;
|
||||
}
|
||||
else {
|
||||
out.sign = 1;
|
||||
out.data[0] = ~~(n / 0x100000000);
|
||||
out.data[1] = n >>> 0;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
export function substractArrayInt64(out, arrayIntA, arrayIntB) {
|
||||
var lowA = arrayIntA.data[1];
|
||||
var highA = arrayIntA.data[0];
|
||||
var signA = arrayIntA.sign;
|
||||
var lowB = arrayIntB.data[1];
|
||||
var highB = arrayIntB.data[0];
|
||||
var signB = arrayIntB.sign;
|
||||
out.sign = 1;
|
||||
if (signA === 1 && signB === -1) {
|
||||
var low_1 = lowA + lowB;
|
||||
var high = highA + highB + (low_1 > 0xffffffff ? 1 : 0);
|
||||
out.data[0] = high >>> 0;
|
||||
out.data[1] = low_1 >>> 0;
|
||||
return out;
|
||||
}
|
||||
var lowFirst = lowA;
|
||||
var highFirst = highA;
|
||||
var lowSecond = lowB;
|
||||
var highSecond = highB;
|
||||
if (signA === -1) {
|
||||
lowFirst = lowB;
|
||||
highFirst = highB;
|
||||
lowSecond = lowA;
|
||||
highSecond = highA;
|
||||
}
|
||||
var reminderLow = 0;
|
||||
var low = lowFirst - lowSecond;
|
||||
if (low < 0) {
|
||||
reminderLow = 1;
|
||||
low = low >>> 0;
|
||||
}
|
||||
out.data[0] = highFirst - highSecond - reminderLow;
|
||||
out.data[1] = low;
|
||||
return out;
|
||||
}
|
||||
21
frontend/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js
generated
vendored
Normal file
21
frontend/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { unsafeUniformIntDistributionInternal } from './UnsafeUniformIntDistributionInternal.js';
|
||||
export function unsafeUniformArrayIntDistributionInternal(out, rangeSize, rng) {
|
||||
var rangeLength = rangeSize.length;
|
||||
while (true) {
|
||||
for (var index = 0; index !== rangeLength; ++index) {
|
||||
var indexRangeSize = index === 0 ? rangeSize[0] + 1 : 0x100000000;
|
||||
var g = unsafeUniformIntDistributionInternal(indexRangeSize, rng);
|
||||
out[index] = g;
|
||||
}
|
||||
for (var index = 0; index !== rangeLength; ++index) {
|
||||
var current = out[index];
|
||||
var currentInRange = rangeSize[index];
|
||||
if (current < currentInRange) {
|
||||
return out;
|
||||
}
|
||||
else if (current > currentInRange) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8
frontend/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js
generated
vendored
Normal file
8
frontend/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export function unsafeUniformIntDistributionInternal(rangeSize, rng) {
|
||||
var MaxAllowed = rangeSize > 2 ? ~~(0x100000000 / rangeSize) * rangeSize : 0x100000000;
|
||||
var deltaV = rng.unsafeNext() + 0x80000000;
|
||||
while (deltaV >= MaxAllowed) {
|
||||
deltaV = rng.unsafeNext() + 0x80000000;
|
||||
}
|
||||
return deltaV % rangeSize;
|
||||
}
|
||||
Reference in New Issue
Block a user