-
Notifications
You must be signed in to change notification settings - Fork 428
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
Updated Next versions and added lint:workspace #4035
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
packages/web/pages/api/broadcast-transaction.tsOops! Something went wrong! :( ESLint: 8.50.0 ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct. The config "next/core-web-vitals" was referenced from the config file in "/packages/web/.eslintrc.json". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. WalkthroughThis pull request focuses on standardizing code formatting across multiple end-to-end (e2e) test files and a page object. The changes primarily involve converting string literals from double quotes to single quotes, removing unnecessary semicolons, and in some cases, prefixing certain variables with underscores. These modifications are purely stylistic and do not alter the functionality of the code, maintaining the existing logic and control flow of the test suites and page objects. Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
packages/e2e/tests/portfolio.wallet.spec.ts (1)
Line range hint
13-13
: Improve private key handling.Using a fallback value 'pk' for the private key could be dangerous if tests accidentally run without proper environment setup. Consider throwing an error if the environment variable is not set.
- const privateKey = process.env.PRIVATE_KEY ?? 'pk' + const privateKey = process.env.PRIVATE_KEY ?? (() => { + throw new Error('PRIVATE_KEY environment variable must be set for tests') + })()
🧹 Nitpick comments (3)
packages/e2e/tests/portfolio.wallet.spec.ts (3)
Line range hint
54-54
: Add meaningful explanations for biome-ignore comments.The
biome-ignore lint/complexity/noForEach
comments lack proper explanations. While usingforEach
for test generation is valid here, document why you're choosing to ignore this lint rule.- // biome-ignore lint/complexity/noForEach: <explanation> + // biome-ignore lint/complexity/noForEach: Using forEach to generate similar test cases is a common pattern in PlaywrightAlso applies to: 77-77
Line range hint
67-67
: Rename misleading variable.The variable
osmoBalance
is used for all token balances, not just OSMO. This could be confusing for maintainers.- const osmoBalance = await portfolioPage.getBalanceFor(name) - expect(osmoBalance).toMatch(dollarBalanceRegEx) + const tokenBalance = await portfolioPage.getBalanceFor(name) + expect(tokenBalance).toMatch(dollarBalanceRegEx)Also applies to: 90-90
Line range hint
28-41
: Consider encapsulating wallet setup logic.The wallet setup process involves multiple steps that could be encapsulated into a helper method for better maintainability and reuse across test files.
Example helper method:
async function setupTestWallet(context: BrowserContext, privateKey: string) { const page = context.pages()[1] const walletPage = new WalletPage(page) await walletPage.importWalletWithPrivateKey(privateKey) await walletPage.setWalletNameAndPassword('Test Portfolio') await walletPage.selectChainsAndSave() await walletPage.finish() return context.pages()[0] }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/e2e/tests/portfolio.wallet.spec.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Analyze (javascript)
- GitHub Check: wait-for-deployment
- GitHub Check: test (20.x, web)
- GitHub Check: Summary
@@ -16,7 +16,7 @@ test.describe('Test Portfolio feature', () => { | |||
let context: BrowserContext | |||
const privateKey = process.env.PRIVATE_KEY ?? 'pk' | |||
let portfolioPage: PortfolioPage | |||
const dollarBalanceRegEx = /\$\d+/ | |||
const dollarBalanceRegEx = /\d+/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider using a more specific regular expression pattern.
The current pattern /\d+/
is too permissive and could match any sequence of digits, potentially leading to false positives in balance verification. Consider using a more specific pattern that:
- Validates the currency symbol (if expected)
- Handles decimal points and cents
- Accounts for thousand separators
- const dollarBalanceRegEx = /\d+/
+ const dollarBalanceRegEx = /\$\d{1,3}(,\d{3})*(\.\d{2})?/
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const dollarBalanceRegEx = /\d+/ | |
const dollarBalanceRegEx = /\$\d{1,3}(,\d{3})*(\.\d{2})?/ |
What is the purpose of the change: