-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 69-feat-implement-the-address-badge-as-a-van…
…illa-component
- Loading branch information
Showing
51 changed files
with
1,624 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/* | ||
dist/* | ||
web-dev-server.config.js | ||
tsup.config.ts | ||
**/test/** | ||
vite.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,8 @@ jobs: | |
- name: Lint | ||
run: yarn run lint | ||
|
||
- name: Test | ||
run: yarn run test | ||
|
||
- name: Build | ||
run: yarn run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
packages/dapp-kit-react/src/Components/ConnectWalletModal/ConnectWalletModal.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/dapp-kit-react/src/Components/ConnectWalletModal/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './ConnectWalletModal'; | ||
export * from './ConnectWalletButtonWithModal'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ node_modules/* | |
dist/* | ||
web-dev-server.config.js | ||
tsup.config.ts | ||
test | ||
vite.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
/node_modules/ | ||
/lib/ | ||
/test/ | ||
custom-elements.json | ||
# top level source | ||
my-element.js | ||
my-element.js.map | ||
my-element.d.ts | ||
my-element.d.ts.map | ||
# only generated for size check | ||
my-element.bundled.js | ||
my-element.bundled.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './components'; | ||
|
||
export * from './client'; | ||
export * from './assets'; | ||
export * from './components'; | ||
|
57 changes: 57 additions & 0 deletions
57
packages/dapp-kit-ui/test/connect-buton-with-modal.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { beforeEach, describe, expect, it } from 'vitest'; | ||
|
||
import { | ||
ConnectButton, | ||
ConnectButtonWithModal, | ||
ConnectModal, | ||
DAppKit, | ||
SourceInfo, | ||
} from '../src'; | ||
import { elementQueries } from './helpers/elemnt-queries'; | ||
import { WalletSource } from '@vechainfoundation/dapp-kit/src'; | ||
|
||
describe('connect-button-with-modal', () => { | ||
beforeEach(() => { | ||
DAppKit.configure({ nodeUrl: 'https://mainnet.vechain.org/' }); | ||
}); | ||
|
||
it('Should callback with source when user clicks a wallet', async () => { | ||
const element: ConnectButtonWithModal = window.document.createElement( | ||
'vwk-connect-button-with-modal', | ||
); | ||
|
||
let selectedSource: WalletSource | undefined; | ||
|
||
element.onSourceClick = (source?: SourceInfo) => { | ||
selectedSource = source?.id; | ||
}; | ||
|
||
window.document.body.appendChild(element); | ||
|
||
const connectButton = | ||
(await elementQueries.getConnectButton()) as ConnectButton; | ||
const connectModal = | ||
(await elementQueries.getConnectModal()) as ConnectModal; | ||
|
||
expect(connectModal).toBeDefined(); | ||
expect(connectButton).toBeDefined(); | ||
|
||
expect(connectModal.open).toBe(false); | ||
|
||
connectButton.shadowRoot?.querySelector('button')?.click(); | ||
|
||
await new Promise((resolve) => setTimeout(resolve, 1000)); | ||
|
||
expect(connectModal.open).toBe(true); | ||
|
||
const sourceCards = await elementQueries.getAllSourceCards(); | ||
|
||
expect(sourceCards.length).toBeGreaterThan(0); | ||
|
||
sourceCards[0]?.shadowRoot?.querySelector('div')?.click(); | ||
|
||
await new Promise((resolve) => setTimeout(resolve, 1000)); | ||
|
||
expect(selectedSource).toBeDefined(); | ||
}); | ||
}); |
Oops, something went wrong.