Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtzData committed Feb 16, 2025
1 parent 30e40a1 commit ecfe140
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/lib/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const LoadDataFile = (url: string): any => {
}
}

export const LoadDataFileRelease = (url: string): any => {
export const LoadDataFileRelease = (url: string) => {

Check failure on line 20 in tests/e2e/lib/File.ts

View workflow job for this annotation

GitHub Actions / tests / Tests

Expected to return a value at the end of arrow function
const u = url.endsWith(`/`) ? url.slice(0, -1) : url
const fileName = u.split(`//`)[1].split(`.`).slice(0, -1).join(`.`)
try {
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/pages/NewHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class NewHomePage extends CommonPage {
}
await this.page.getByRole(`tab`, { name: `Metadata` }).click()
await this.delay(3000)
if (await this.page.locator('body >> select').isVisible()) {
if (await this.page.locator(`body >> select`).isVisible()) {
return
}
await this.page.click(`body >> text=/Table/`)
Expand Down Expand Up @@ -185,7 +185,7 @@ export class NewHomePage extends CommonPage {
async checkInventoryERC404MetadataTab(data: any): Promise<void> {
await this.page.getByRole(`tab`, { name: `Metadata` }).click()
await this.delay(3000)
if (await this.page.locator('body >> select').isVisible()) {
if (await this.page.locator(`body >> select`).isVisible()) {
return
}
await this.page.click(`body >> text=/Table/`)
Expand Down Expand Up @@ -219,7 +219,7 @@ export class NewHomePage extends CommonPage {
}
await this.page.getByRole(`tab`, { name: `Metadata` }).click()
await this.delay(3000)
if (await this.page.locator('body >> select').isVisible()) {
if (await this.page.locator(`body >> select`).isVisible()) {
return
}
await this.page.click(`body >> text=/Table/`)
Expand Down
64 changes: 32 additions & 32 deletions tests/e2e/tests/api/api.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {test, expect} from '@playwright/test'
import {LoadDataFile} from "@lib/File"
import { test, expect } from '@playwright/test'
import { LoadDataFile } from "@lib/File"
import chalk from "chalk"
import {shouldRunWithRelease} from "../common"
import { shouldRunWithRelease } from "../common"

test.describe.configure({mode: `parallel`})
test.describe.configure({ mode: `parallel` })

const contractsInfoURL = `https://contracts-info.services.blockscout.com`
const adminURL = `https://admin-rs.services.blockscout.com`
Expand Down Expand Up @@ -32,7 +32,7 @@ const urlToChainIdMap = {

urls.forEach((url: string) => {
LoadDataFile(url)
test(`@Api @Health ${url} Check health`, async ({request}): Promise<void> => {
test(`@Api @Health ${url} Check health`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/health`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -51,7 +51,7 @@ urls.forEach((url: string) => {
expect(diff).toBeLessThan(10)
}
})
test(`@Api ${url} Check transactions`, async ({request}): Promise<void> => {
test(`@Api ${url} Check transactions`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/transactions?filter=validated`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -61,7 +61,7 @@ urls.forEach((url: string) => {
expect(tx.hash).toBeDefined()
}
})
test(`@Api ${url} Check blocks`, async ({request}): Promise<void> => {
test(`@Api ${url} Check blocks`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/blocks?type=block`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -71,7 +71,7 @@ urls.forEach((url: string) => {
expect(blk.size).toBeDefined()
}
})
test(`@Api ${url} Check main page blocks`, async ({request}): Promise<void> => {
test(`@Api ${url} Check main page blocks`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/main-page/blocks`)
expect(resp.status()).toBe(200)
const blocks = await resp.json()
Expand All @@ -81,7 +81,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check main page transactions`, async ({request}): Promise<void> => {
test(`@Api ${url} Check main page transactions`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/main-page/transactions`)
expect(resp.status()).toBe(200)
const txs = await resp.json()
Expand All @@ -91,7 +91,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check main page chart txs`, async ({request}): Promise<void> => {
test(`@Api ${url} Check main page chart txs`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/stats/charts/transactions`)
expect(resp.status()).toBe(200)
const txs = await resp.json()
Expand All @@ -100,7 +100,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check main page stats`, async ({request}): Promise<void> => {
test(`@Api ${url} Check main page stats`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/stats`)
expect(resp.status()).toBe(200)
const stats = await resp.json()
Expand All @@ -109,7 +109,7 @@ urls.forEach((url: string) => {
expect(stats.gas_prices).toBeDefined()
})

test(`@Api ${url} Check top accounts`, async ({request}): Promise<void> => {
test(`@Api ${url} Check top accounts`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/addresses`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -118,7 +118,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check tokens`, async ({request}): Promise<void> => {
test(`@Api ${url} Check tokens`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/tokens`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -127,7 +127,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check token transfers`, async ({request}): Promise<void> => {
test(`@Api ${url} Check token transfers`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/token-transfers?type=`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -136,7 +136,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check DEX pools`, async ({request}): Promise<void> => {
test(`@Api ${url} Check DEX pools`, async ({ request }): Promise<void> => {
const resp = await request.get(`${contractsInfoURL}/api/v1/chains/${urlToChainIdMap[url]}/pools`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -145,15 +145,15 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check DApps`, async ({request}): Promise<void> => {
test(`@Api ${url} Check DApps`, async ({ request }): Promise<void> => {
const resp = await request.get(`${adminURL}/api/v1/chains/${contractsInfoURL[url]}/marketplace/dapps`)
expect(resp.status()).toBe(200)
const body = await resp.json()
for (const dapp of body) {
expect(dapp.title).toBeDefined()
}
})
test(`@Api ${url} Check User Ops`, async ({request}): Promise<void> => {
test(`@Api ${url} Check User Ops`, async ({ request }): Promise<void> => {
if (url.includes(`eth-sepolia`, `gnosis`, `eth.blockscout`, `base`, `optimism`, `neon`, `polygon`, `explorer`)) {
const resp = await request.get(`${url}/api/v2/proxy/account-abstraction/operations`)
expect(resp.status()).toBe(200)
Expand All @@ -163,7 +163,7 @@ urls.forEach((url: string) => {
}
}
})
test(`@Api ${url} Check Verified Contracts`, async ({request}): Promise<void> => {
test(`@Api ${url} Check Verified Contracts`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/smart-contracts`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -172,7 +172,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check Domains`, async ({request}): Promise<void> => {
test(`@Api ${url} Check Domains`, async ({ request }): Promise<void> => {
if (url.includes(`eth-sepolia`, `gnosis`, `eth.blockscout`, `base`, `optimism`, `neon`, `polygon`, `explorer`)) {
const resp = await request.get(`${bensURL}/api/v1/${urlToChainIdMap[url]}/domains:lookup?only_active=true`)
expect(resp.status()).toBe(200)
Expand All @@ -182,7 +182,7 @@ urls.forEach((url: string) => {
}
}
})
test(`@Api ${url} Check Withdrawals`, async ({request}): Promise<void> => {
test(`@Api ${url} Check Withdrawals`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/withdrawals`)
expect(resp.status()).toBe(200)
const body = await resp.json()
Expand All @@ -191,7 +191,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api ${url} Check account abstraction status`, async ({request}): Promise<void> => {
test(`@Api ${url} Check account abstraction status`, async ({ request }): Promise<void> => {
if (shouldRunWithRelease(`v7.0.0`, `v7.0.0`)) {
const resp = await request.get(`${url}/api/v2/proxy/account-abstraction/status`)
expect(resp.status()).toBe(200)
Expand All @@ -205,7 +205,7 @@ urls.forEach((url: string) => {
}
})

test(`@Api @L2 ${url} Check Optimism type deposits`, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Optimism type deposits`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/optimism/deposits`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -216,7 +216,7 @@ urls.forEach((url: string) => {
expect(body.items[0].l2_transaction_hash).toBeDefined()
})

test(`@Api @L2 ${url} Check ZKEVM type deposits`, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check ZKEVM type deposits`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/zkevm/deposits`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -227,7 +227,7 @@ urls.forEach((url: string) => {
expect(body.items[0].l2_transaction_hash).toBeDefined()
})

test(`@Api @L2 ${url} Check Arbitrum type deposits`, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Arbitrum type deposits`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/arbitrum/messages/to-rollup`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -238,7 +238,7 @@ urls.forEach((url: string) => {
// console.log(`resp: ${JSON.stringify(body, null, "")}`)
})

test(`@Api @L2 ${url} Check Optimism type withdrawals`, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Optimism type withdrawals`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/optimism/withdrawals`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -249,7 +249,7 @@ urls.forEach((url: string) => {
expect(body.items[0].l2_transaction_hash).toBeDefined()
})

test(`@Api @L2 ${url} Check ZKEVM type withdrawals`, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check ZKEVM type withdrawals`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/zkevm/withdrawals`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -260,7 +260,7 @@ urls.forEach((url: string) => {
expect(body.items[0].l2_transaction_hash).toBeDefined()
})

test(`@Api @L2 ${url} Check Arbitrum type withdrawals`, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Arbitrum type withdrawals`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/arbitrum/messages/from-rollup`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -271,7 +271,7 @@ urls.forEach((url: string) => {
expect(body.items[0].status).toBeDefined()
})

test(`@Api @L2 ${url} Check Optimism batches `, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Optimism batches `, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/optimism/batches`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -282,7 +282,7 @@ urls.forEach((url: string) => {
expect(body.items[0].l2_block_start).toBeDefined()
})

test(`@Api @L2 ${url} Check ZKEVM batches `, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check ZKEVM batches `, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/zkevm/batches`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -293,7 +293,7 @@ urls.forEach((url: string) => {
expect(body.items[0].timestamp).toBeDefined()
})

test(`@Api @L2 ${url} Check Arbitrum batches `, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Arbitrum batches `, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/arbitrum/batches`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -304,7 +304,7 @@ urls.forEach((url: string) => {
expect(body.items[0].commitment_transaction.hash).toBeDefined()
})

test(`@Api @L2 ${url} Check Optimism dispute games `, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Optimism dispute games `, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/optimism/games`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand All @@ -315,7 +315,7 @@ urls.forEach((url: string) => {
expect(body.items[0].l2_block_number).toBeDefined()
})

test(`@Api @L2 ${url} Check Optimism output roots`, async ({request}): Promise<void> => {
test(`@Api @L2 ${url} Check Optimism output roots`, async ({ request }): Promise<void> => {
const resp = await request.get(`${url}/api/v2/optimism/output-roots`)
const body = await resp.json()
if (resp.status() === 400 && body.message.includes(`module`)) {
Expand Down

0 comments on commit ecfe140

Please sign in to comment.