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

chore: Verify API tests #2467

Merged
merged 18 commits into from
Aug 19, 2024
Merged

chore: Verify API tests #2467

merged 18 commits into from
Aug 19, 2024

Conversation

chris13524
Copy link
Member

@chris13524 chris13524 commented Jun 26, 2024

Changes

  • chore: Verify API tests

Other

Danger: Ignore apps/laboratory/src/pages/library/verify-valid.tsx uses localhost: which is likely a mistake

@chris13524 chris13524 self-assigned this Jun 26, 2024
Copy link

vercel bot commented Jun 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Aug 19, 2024 6:13pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Aug 19, 2024 6:13pm


const uri = await modalPage.getConnectUri()
await walletPage.connectWithUri(uri)
await expect(walletPage.page.getByText('Website flagged')).toBeVisible()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be on the validator?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertions are generally on the validator (ModalValidator)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to over-abstract this. IMO fine as-is

Copy link
Contributor

github-actions bot commented Aug 9, 2024

Warnings
⚠️ Changes were made to one or more package.json(s), but not to pnpm-lock.yaml

Generated by 🚫 dangerJS against d642e39

Copy link
Contributor

github-actions bot commented Aug 15, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 109.11999999999999% 2768 / 9051
🔵 Statements 109.11999999999999% 2768 / 9051
🔵 Functions 154.01999999999998% 208 / 677
🔵 Branches 214.52999999999997% 355 / 752
File CoverageNo changed files found.
Generated in workflow #5642

Copy link
Contributor

github-actions bot commented Aug 15, 2024

♻️ Vite-Size ♻️

Size Difference

Size (kb) Gzip (kb)
Total Diff. 0 0

Current Size

Name Size (kb) Gzip (kb)
assets/index-De7pmoDH.js 1587.744 459.842
assets/noble-curves.js 31.941 12.78
assets/2.19.6_bufferutil.js 2.789 1.326
assets/index.js 102.248 29.11
assets/index2.js 304.088 87.214
assets/walletconnect-ethereum-provider.js 458.547 145.451
assets/index3.js 9.058 3.076
assets/index4.js 11.576 3.201
assets/w3m-modal.js 6.848 2.479
assets/index5.js 9.412 3.342
assets/hooks.module.js 77.228 26.416
assets/walletconnect-modal-ui.js 112.43 34.327
index.html 0.329 0.235
Total Size 2714.238 808.799

Base Size

Name Size (kb) Gzip (kb)
assets/index-De7pmoDH.js 1587.744 459.842
assets/noble-curves.js 31.941 12.78
assets/2.19.6_bufferutil.js 2.789 1.326
assets/index.js 102.248 29.11
assets/index2.js 304.088 87.214
assets/walletconnect-ethereum-provider.js 458.547 145.451
assets/index3.js 9.058 3.076
assets/index4.js 11.576 3.201
assets/w3m-modal.js 6.848 2.479
assets/index5.js 9.412 3.342
assets/hooks.module.js 77.228 26.416
assets/walletconnect-modal-ui.js 112.43 34.327
index.html 0.329 0.235
Total Size 2714.238 808.799

@lukaisailovic
Copy link
Contributor

Why did we remove ModalValidator from the Fixture and instead instantiate it multiple times?

@chris13524
Copy link
Member Author

Why did we remove ModalValidator from the Fixture and instead instantiate it multiple times?

I did that in this PR as we were trying to improve test reliability and fixtures were a potential source of distrust.

@@ -0,0 +1,56 @@
import { createWeb3Modal } from '@web3modal/wagmi/react'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different from our regular pages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata URL is set to https://localhost:3000 and it uses a special project ID with Verify API enabled on localhost

import { ModalPage } from '../pages/ModalPage'
import { timingFixture } from './timing-fixture'

export const testMVerifyDomainMismatch = timingFixture.extend<ModalFixture>({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use a fixture here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we are making ModalPage inside the fixture and I need to supply custom config to it, requiring a different fixture.

I could make a new ModalPage using the same fixture, but then wouldn't it be doing unnecessary loading of the wrong page?


function getUrlByFlavor(baseUrl: string, library: string, flavor: ModalFlavor) {
const urlsByFlavor: Partial<Record<ModalFlavor, string>> = {
default: `${baseUrl}library/${library}/`,
external: `${baseUrl}library/external/`
external: `${baseUrl}library/external/`,
'verify-valid': `${baseUrl}library/verify-valid/`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the special cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we need to load the special configurations that are on these pages

@chris13524 chris13524 merged commit d345a43 into main Aug 19, 2024
12 checks passed
@chris13524 chris13524 deleted the chore/verify-tests branch August 19, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants