Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[site] Display encoded payment request and internal status on received payment d #395

Merged
merged 101 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
481ddc1
[site] Display encoded payment request and internal status on receive…
coreymartin Mar 9, 2024
56fe071
Bump vite from 5.0.5 to 5.0.12 in /js (#9515)
dependabot[bot] Mar 19, 2024
64e3dba
CI update lock file for PR
Mar 19, 2024
759571a
Bump ip from 1.1.8 to 1.1.9 in /js/packages/react-native/examples/Rea…
dependabot[bot] Mar 19, 2024
75b931d
Bump follow-redirects from 1.15.3 to 1.15.6 in /js/packages/react-nat…
dependabot[bot] Mar 19, 2024
dd10362
Bump jose from 4.15.4 to 4.15.5 in /js (#9537)
dependabot[bot] Mar 20, 2024
55b518c
CI update lock file for PR
Mar 20, 2024
4efd5a3
Update semver to 7.6.0 (#9540)
zhenlu Mar 20, 2024
d047c5b
Update the JS demo vasp to 0.8.1 uma sdk. (#9543)
jklein24 Mar 20, 2024
4268f4b
CI update lock file for PR
Mar 20, 2024
c0c09ed
Bump the uma vasp sdk version to 0.8.2 (#9563)
jklein24 Mar 20, 2024
a154bb6
CI update lock file for PR
Mar 20, 2024
d29d002
[docs] add uma introduction video (#9569)
bsiaotickchong Mar 21, 2024
5d05d3c
Add multi capability to IdFilter and StringFilter (#9458)
bsiaotickchong Mar 21, 2024
9a447b0
Add Badge themes and add badges to webhook log (#9467)
bsiaotickchong Mar 21, 2024
d99252f
Bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /js/packages/react…
dependabot[bot] Mar 21, 2024
6be328f
[ops] move ops inspector search to header, fix search button (#9639)
bsiaotickchong Mar 26, 2024
2be22d9
Update UMA integration tests to include V1 images. (#9510)
jklein24 Mar 26, 2024
8267fe5
Update the vasp CLI tool for umav1 (#9840)
jklein24 Apr 3, 2024
47bf3b1
Update the demo vasp to use uma 1.0 (#9218)
shreyav Apr 4, 2024
8a66aa3
CI update lock file for PR
Apr 4, 2024
ea1e297
Update demo vasp to use post-tx callback utils and verify signature (…
shreyav Apr 4, 2024
4cfdfd6
[ui] Move PageSectionNav to new UI component (#9971)
coreymartin Apr 10, 2024
6a2f2c6
[ui] Move all PageSection components and Dropdown to public UI (#9979)
coreymartin Apr 10, 2024
6e6fa4d
[js] Upgrade Apollo (#10052)
coreymartin Apr 15, 2024
4dc91dd
CI update lock file for PR
Apr 15, 2024
9f1b682
[ui] Allow Modal submit to be a link (#10066)
coreymartin Apr 16, 2024
fa046a8
[transactions_report] Remove time filter for reporting (#10107)
dawit-0 Apr 17, 2024
fe8027a
CI update lock file for PR
Apr 17, 2024
cb5a9f4
Update readmes related to uma certs (#10139)
shreyav Apr 18, 2024
24c4572
[uma-bridge] Initial Plaid integration (#10146)
coreymartin Apr 19, 2024
3e1839f
[ui] Move themes to own file. Simplify colors (#10167)
coreymartin Apr 20, 2024
b52bc40
[ui] Move typography and tokens (#10172)
coreymartin Apr 22, 2024
5f8556f
[ui] Improve theme typography tokens and add bridge tokens (#10189)
coreymartin Apr 22, 2024
a4d35c1
[ui] Move typography to components (#10178)
coreymartin Apr 22, 2024
0e23c84
Create wise-tables-knock.md
coreymartin Apr 22, 2024
59ffbd7
[ui] Remove unused icons (#10179)
coreymartin Apr 22, 2024
3f57fb3
Some vasp cli fixes for sender-locked amounts (#10207)
jklein24 Apr 23, 2024
3d2ab59
[ui] Preload icons. Switch to ui/src path for imports (#10182)
coreymartin Apr 23, 2024
69a941c
[static] Add new static workspace and upload to S3 (#10230)
coreymartin Apr 24, 2024
c92a867
[colors] fix invalid color string (#10231)
bsiaotickchong Apr 24, 2024
c406c9a
[js] Dummy change to trigger build
mgorven Apr 24, 2024
82d9a2a
[uda] Initial working version of UDA (#10198)
bsiaotickchong Apr 24, 2024
3c63229
Support non-uma receiver in demo vasp (#10225)
shreyav Apr 24, 2024
f25f1eb
[site] Improve balance tooltips and messaging (#10236)
coreymartin Apr 24, 2024
46c58db
[gha] release: Check that frontend version exists before deploying
mgorven Apr 24, 2024
ca78f8a
[ui] Fix InfoIconTooltip debugging prop (#10261)
coreymartin Apr 25, 2024
3fa8cf2
[ops] migrate channels connection page to DataManagerTable, add Radio…
bsiaotickchong May 1, 2024
c26649b
[bridge] Separate bank / KYC pages (#10262)
coreymartin May 3, 2024
4ba87d1
[ui] Typography improvements (#10331)
coreymartin May 8, 2024
abedcb7
[ui] Convert Label (#10436)
coreymartin May 8, 2024
81f5e08
Added some basic action scraping to Github bot. (#10482)
mhrheaume May 9, 2024
3a00349
[site] Allow full precision BTC display amounts (#10489)
coreymartin May 9, 2024
cf6ccb6
[ui] Add NextLink as a ToReactNode type (#10432)
coreymartin May 9, 2024
78031a6
[ui] Updated banner style (#10434)
coreymartin May 9, 2024
f5095eb
[uma-bridge] Start page (#10485)
coreymartin May 11, 2024
adde441
[site] Fix z-index for some Banner types (#10535)
coreymartin May 11, 2024
3e45e9d
[ui] Button improvements (#10507)
coreymartin May 13, 2024
eb7bcdd
[uma-bridge] Update to latest typography tokens (#10536)
coreymartin May 13, 2024
b77a3e4
[js] Upgrade codegen (#10537)
coreymartin May 13, 2024
05f5440
[js-sdk] Compress requests with deflate
mgorven May 10, 2024
e2b0b8a
[js] Move and rename transformGQLName (#10592)
coreymartin May 15, 2024
04c5131
[site] Complete new account creation (#10562)
coreymartin May 15, 2024
e83c40e
Adding UX guidelines to Uma.me (#10572)
pengying May 15, 2024
f4f4dce
[ui] Provide icon color inversion when color is specified (#10630)
coreymartin May 16, 2024
5dd9db0
[site] Re-enable UI tests (#10627)
coreymartin May 16, 2024
2dc9016
[uma-bridge] Configure GQL client with react-query (#10538)
coreymartin May 16, 2024
8fb99c9
Feature flag new ui in SelectPlan page, add icons (#10618)
shreyav May 16, 2024
cb9c86c
[uma-bridge] Autocomplete hint for account creation and invalid token…
coreymartin May 16, 2024
7fc0c2e
[ui/docs] add Headline ExtraSmall design token, handle h4 and h5 in d…
bsiaotickchong May 17, 2024
655416d
[site] Ignore ResizeObserver errors in Cypress (#10701)
coreymartin May 17, 2024
fe6274e
[uma-bridge] SecureAccountMFA page (#10702)
coreymartin May 20, 2024
3ee0e9b
[ui] Fix theme settings (#10734)
coreymartin May 21, 2024
5ce03ff
[uma-bridge] Login (#10732)
coreymartin May 21, 2024
7b80f99
[uma-bridge] GetUma page (#10741)
coreymartin May 22, 2024
1fcb460
[uma-bridge] FAQ page (#10753)
shreyav May 22, 2024
1391efc
[uma-bridge] Banner progress state (#10757)
coreymartin May 23, 2024
7c073bb
[uma-bridge] Desktop Banner styles (#10778)
coreymartin May 24, 2024
d4b36e2
[uma-bridge] account page initial setup (#10822)
shreyav May 24, 2024
1dafa7f
[uma-bridge] Add themed Loading component (#10834)
coreymartin May 29, 2024
5186240
[ui/bridge] add common Drawer component, optionally use in Modal (#10…
bsiaotickchong May 29, 2024
b7ebcb4
[uma-bridge] Support buttons styling, update gql query (#10885)
shreyav May 29, 2024
2ce6c54
[uma-bridge] Fix logged in desktop header styles (#10839)
coreymartin May 29, 2024
2c4143b
[uma-bridge] Card header styles (#10842)
coreymartin May 30, 2024
220baa9
[uma-bridge] Payment settings styling, use real bank info (#10895)
shreyav May 30, 2024
839fa80
[uma-bridge] add log out button to help modal/drawer, add more help m…
bsiaotickchong May 30, 2024
0fdbe55
[uma-bridge] add abstraction for help modal data (#10905)
bsiaotickchong May 30, 2024
d88e7a8
[site] Show msats on TransactionDetails page (#10955)
coreymartin Jun 3, 2024
736597c
Add frontend Recapcha v3 support for account creation (#10922)
joelweinberger Jun 3, 2024
0f7d0e0
[uma-bridge] Display KYC rejected state on VerifyIdentity (#10940)
coreymartin Jun 3, 2024
c23afd7
[ui-test-app] Remove private dependency (#10968)
coreymartin Jun 3, 2024
ece59ef
CI update lock file for PR
Jun 3, 2024
9779957
trigger change
coreymartin Jun 3, 2024
64df5e7
[uma-vasp] Upgrade UMA core version and fix type issue (#10980)
coreymartin Jun 4, 2024
9f480fe
CI update lock file for PR
Jun 4, 2024
f65250e
[js] Move deploy script to private (#10982)
coreymartin Jun 4, 2024
31fcba6
Create warm-vans-change.md
coreymartin Jun 4, 2024
015943b
Create wild-beans-suffer.md
coreymartin Jun 4, 2024
09eeb6d
Update from public js-sdk main branch (#9385)
lightspark-ci-js-sdk[bot] Jun 4, 2024
6eb38f6
CI update lock file for PR
Jun 4, 2024
0d7b7da
[ui-test-app] Remove GlobalErrorBoundary private dep (#10990)
coreymartin Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .changeset/warm-vans-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"@lightsparkdev/ui": patch
---

- Remove unused icons (#10179)
- Preload icons (#10182)
- Fix invalid color string (#10231)
- Add ChevronLeft icon (#10198)
- Add InfoIconTooltip component and improve Tooltip (#10236)
- Add Radio component (#10350)
- Typography and theme improvements (#10331)
- Add Banner component (#10262)
- Consolidate specifying full precision for currencies (#1095)
- Add NextLink as a ToReactNode type (#10432)
- Button improvements (#10507)
- Update to latest typography tokens (#10536)
- Add transformGQLName (#10592)
- ToReactNodes improvements and tests (#10562)
- Add icons (#10572)
- Provide icon color inversion when color is specified (#10630)
- Add PhoneInput component (#10702)
- Add useDebounce hook (#10741)
- Add common Drawer component, optionally use in Modal (#10819)
6 changes: 6 additions & 0 deletions .changeset/wild-beans-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@lightsparkdev/core": minor
---

- Move formatCurrencyStr options into an object (#1095)
- Compress requests with deflate (#10512)
12 changes: 12 additions & 0 deletions .changeset/wise-tables-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@lightsparkdev/ui": major
---

- Move PageSectionNav to new UI component (#9971)
- Move all PageSection components and Dropdown to public UI (#9979)
- Allow Modal submit to be a link (#10066)
- Move themes to own file. Simplify colors (#10167)
- Move typography and tokens (#10172)
- Improve theme typography tokens and add bridge tokens (#10189)
- Move typography to components (#10178)
- Update dependencies
2 changes: 1 addition & 1 deletion apps/examples/oauth-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"eslint-watch": "^8.0.0",
"tsc-absolute": "^1.0.1",
"typescript": "^5.0.0",
"vite": "^5.0.5"
"vite": "^5.1.6"
},
"scripts": {
"start": "yarn vite",
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/oauth-app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "./index.css";
import reportWebVitals from "./reportWebVitals";
import { Root } from "./Root";
import { ThemeProvider } from "@emotion/react";
import { themes } from "@lightsparkdev/ui/styles/colors";
import { themes } from "@lightsparkdev/ui/styles/themes";

const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/oauth-app/src/pages/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function DashboardPage() {
<div>
<Header>
<Button
primary
kind="primary"
text="Sign out"
onClick={() => {
auth.signout().catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/oauth-app/src/pages/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const LoginPage = () => {
return (
<Container>
<Description>Log into your Lightspark account to continue</Description>
<Button text="Login" primary onClick={handleLogin} />
<Button text="Login" kind="primary" onClick={handleLogin} />
</Container>
);
};
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/react-wallet-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"eslint-watch": "^8.0.0",
"tsc-absolute": "^1.0.1",
"typescript": "^5.0.0",
"vite": "^5.0.5"
"vite": "^5.1.6"
},
"engines": {
"node": ">=18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Dashboard = ({ data }: { data: WalletDashboard }) => {
<ActionsBar>
<Button
text="Send Payment"
primary
kind="primary"
// mt={isSm ? 0 : 24}
// loading={sendingPayment}
// onClick={onSubmit}
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/react-wallet-app/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ThemeProvider } from "@emotion/react";
import { themes } from "@lightsparkdev/ui/styles/colors";
import { themes } from "@lightsparkdev/ui/styles/themes";
import { GlobalStyles } from "@lightsparkdev/ui/styles/global";
import React from "react";
import ReactDOM from "react-dom/client";
Expand Down
6 changes: 3 additions & 3 deletions apps/examples/react-wallet-app/src/pages/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function DashboardPage() {
<Header>
<Button
text="Sign out"
primary
kind="primary"
onClick={() => {
void (async () => {
await auth.logout();
Expand All @@ -130,7 +130,7 @@ const DeployWallet = ({
return (
<div>
<h1>Wallet not yet deployed. Status: {status}</h1>
<Button primary onClick={onDeploy} text="Deploy Wallet" />
<Button kind="primary" onClick={onDeploy} text="Deploy Wallet" />
</div>
);
};
Expand All @@ -145,7 +145,7 @@ const InitializeWallet = ({
return (
<div>
<h1>Wallet not yet initialized. Status: {status}</h1>
<Button primary onClick={onInitialize} text="Initialize Wallet" />
<Button kind="primary" onClick={onInitialize} text="Initialize Wallet" />
</div>
);
};
Expand Down
15 changes: 10 additions & 5 deletions apps/examples/react-wallet-app/src/pages/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ const LoginPage = () => {

const generateDemoTokens = async () => {
const { token: jwt, accountId: jwtServerAccountId } = await fetch(
`${jwtServerUrl.replace(/\/$/, "")}/getJwt?userId=${userName}&password=${password}`,
`${jwtServerUrl.replace(
/\/$/,
""
)}/getJwt?userId=${userName}&password=${password}`,
{
method: "GET",
headers: {
"ngrok-skip-browser-warning": "true",
}
},
}
).then((res) => res.json() as Promise<{ token: string, accountId: string }>);
).then(
(res) => res.json() as Promise<{ token: string; accountId: string }>
);
await auth.login(jwtServerAccountId, jwt);
navigate(Routes.Dashboard);
};
Expand All @@ -62,7 +67,7 @@ const LoginPage = () => {
onChange={(e) => setJwt(e.target.value)}
/>
</Label>
<Button primary onClick={handleLogin} text="Login" />
<Button kind="primary" onClick={handleLogin} text="Login" />

<Description>
Alternatively, use our demo jwt server with a user name and password.
Expand Down Expand Up @@ -94,7 +99,7 @@ const LoginPage = () => {
/>
</Label>
<Button
primary
kind="primary"
onClick={() => {
void generateDemoTokens();
}}
Expand Down
3 changes: 3 additions & 0 deletions apps/examples/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
},
"umaVasp": {
"port": 3104
},
"uiTestApp": {
"port": 3105
}
}
2 changes: 1 addition & 1 deletion apps/examples/streaming-wallet-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"eslint-watch": "^8.0.0",
"tsc-absolute": "^1.0.1",
"typescript": "^5.0.0",
"vite": "^5.0.5"
"vite": "^5.1.6"
},
"engines": {
"node": ">=18"
Expand Down
7 changes: 3 additions & 4 deletions apps/examples/streaming-wallet-extension/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ import StreamingDemoAccountCredentials from "./auth/StreamingDemoCredentials";
import VideoProgressCache from "./background/VideoProgressCache";
import { clearStorageKeepingInstanceId } from "./common/storage";
import { findActiveStreamingDemoTabs } from "./common/streamingTabs";
import CirclePlusIcon from "./components/CirclePlusIcon";
import CurrencyAmountElement from "./components/CurrencyAmount";
import CurrencyAmountRaw from "./components/CurrencyAmountRaw";
import LeftArrow from "./components/LeftArrow";
import { LoadingSpinner } from "./components/Loading";
import StreamingTransactionChip from "./components/StreamingTransactionChip";
import TransactionRow from "./components/TransactionRow";
import { getWalletClient } from "./lightsparkClientProvider";
import { Icon } from "@lightsparkdev/ui/components";

enum Screen {
Balance,
Expand Down Expand Up @@ -224,7 +223,7 @@ function Header(screen: Screen, setScreen: (screen: Screen) => void) {
return (
<div className="header">
<button onClick={() => setScreen(Screen.Balance)}>
<LeftArrow />
<Icon name="LeftArrow" width={16} />
</button>
<HeaderBackText>Transactions</HeaderBackText>
</div>
Expand Down Expand Up @@ -341,7 +340,7 @@ function LoginScreen(props: {
<CreateWalletButton onClick={createWallet} disabled={isLoading}>
{!isLoading ? (
<span style={{ marginInlineEnd: "8px", height: "13px" }}>
<CirclePlusIcon />
<Icon name="CirclePlus" width={12} />
</span>
) : (
<></>
Expand Down

This file was deleted.

This file was deleted.

23 changes: 23 additions & 0 deletions apps/examples/ui-test-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
extends: ["@lightsparkdev/eslint-config/react-lib"],
/* Mainly keeping this file around for reference for future public react lib, ignore in lint: */
ignorePatterns: ["src/generated/"],
overrides: [
{
files: ["**/src/**/*.ts?(x)"],
excludedFiles: ["**/tests/**/*.ts?(x)"],
rules: {
/* Temporarily turn off no-explicit-any until these can be resolved LIG-3400: */
"@typescript-eslint/no-explicit-any": "off",
/* Too many of these type-aware errors, turn off for now: */
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
},
},
],
};
1 change: 1 addition & 0 deletions apps/examples/ui-test-app/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/generated/
3 changes: 3 additions & 0 deletions apps/examples/ui-test-app/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["prettier-plugin-organize-imports"]
}
11 changes: 11 additions & 0 deletions apps/examples/ui-test-app/gql-codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
overwrite: true
schema: ["../../../../sparkcore/graphql_schemas/first_party_schema.graphql"]
documents: ["src/**/*.tsx"]
generates:
src/generated/graphql.tsx:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
config:
nonOptionalTypename: true
43 changes: 43 additions & 0 deletions apps/examples/ui-test-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head data-commit="__CURRENT_COMMIT__">
<meta charset="utf-8" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.ico" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-16.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Lightspark is building infrastructure for the Lightning Network to deliver open payments for the Internet at scale. Lightspark services and tools aim to be the fastest, easiest and most reliable way to send and receive payments globally, with exceptionally low fees, using the Lightning Network."
/>
<link rel="apple-touch-icon" href="/logo192.png" />

<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />

<title>Lightspark</title>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript>
<!-- Can't switch the gtm id dynamically without js, assume prod: -->
<iframe
src="https://www.googletagmanager.com/ns.html?id=<%= gtmProdId %>"
height="0"
width="0"
style="display: none; visibility: hidden"
></iframe
></noscript>
<!-- End Google Tag Manager (noscript) -->

<noscript>You need to enable JavaScript to run this app.</noscript>

<div id="root"></div>

<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const config: JestConfigWithTsJest = {
testTimeout: 20000,
moduleNameMapper: {
"^.+\\.(css|svg|png)$": "identity-obj-proxy",
/* ts-jest doesn't support .js imports which are required for making imports work in
the published ui package. See issue https://bit.ly/3TF1uSS */
"(.+)\\.js": "$1",
},
setupFiles: ["<rootDir>/jest/setup.ts"],
setupFilesAfterEnv: ["<rootDir>/jest/setupAfterEnv.ts"],
Expand Down
23 changes: 23 additions & 0 deletions apps/examples/ui-test-app/jest/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Import node libs to polyfill browser objects */
import crypto from "crypto";
import ResizeObserver from "resize-observer-polyfill";

import { TextDecoder, TextEncoder } from "util";

Object.defineProperties(global.self, {
crypto: {
value: {
getRandomValues: (arr: NodeJS.ArrayBufferView) =>
crypto.randomFillSync(arr),
subtle: crypto.webcrypto.subtle,
},
},
TextEncoder: {
value: TextEncoder,
},
TextDecoder: {
value: TextDecoder,
},
});

global.ResizeObserver = ResizeObserver;
1 change: 1 addition & 0 deletions apps/examples/ui-test-app/jest/setupAfterEnv.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@testing-library/jest-dom";
Loading
Loading