Skip to content

Commit

Permalink
Merge branch 'main' of github.com:guildxyz/guild.xyz into profiles-page
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Jul 30, 2024
2 parents a993155 + 8072a91 commit cfbf8f1
Show file tree
Hide file tree
Showing 101 changed files with 1,076 additions and 974 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ jobs:
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Run Playwright tests
env:
DEPLOYMENT_URL: ${{ github.event.deployment_status.target_url }}
ANVIL_FORK_URL: ${{ secrets.ANVIL_FORK_URL }}
NEXT_PUBLIC_E2E_WALLET_MNEMONIC: ${{ secrets.E2E_WALLET_MNEMONIC }}
run: npm run test
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
Expand Down
8 changes: 5 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off",
"noUnusedImports": "error"
"noUnusedImports": "error",
"useExhaustiveDependencies": "warn"
},
"style": {
"noInferrableTypes": "error",
Expand All @@ -51,7 +52,7 @@
"noArguments": "error",
"noVar": "error",
"useConst": "error",
"noDefaultExport": "warn"
"noDefaultExport": "info"
},
"suspicious": {
"noExplicitAny": "info",
Expand All @@ -73,7 +74,8 @@
},
"nursery": {
"useSortedClasses": "info"
}
},
"performance": { "noBarrelFile": "warn" }
}
},
"javascript": {
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@emotion/styled": "^11.11.0",
"@fuels/connectors": "^0.5.0",
"@fuels/react": "^0.20.0",
"@guildxyz/types": "1.9.27",
"@guildxyz/types": "1.9.28",
"@hcaptcha/react-hcaptcha": "^1.4.4",
"@hookform/resolvers": "^3.3.4",
"@lexical/code": "^0.12.0",
Expand Down Expand Up @@ -143,6 +143,7 @@
"abitype": "^1.0.2",
"autoprefixer": "^10.4.19",
"circular-dependency-plugin": "^5.2.2",
"dotenv": "^16.4.5",
"dotenv-cli": "^7.4.1",
"dpdm": "^3.14.0",
"event-stream": "^4.0.1",
Expand Down
48 changes: 15 additions & 33 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import path from "node:path"
import { defineConfig, devices } from "@playwright/test"
import dotenv from "dotenv"
dotenv.config({ path: path.resolve(__dirname, ".env.local") })

const baseURL = process.env.DEPLOYMENT_URL || "http://localhost:3000"

// biome-ignore lint/style/noDefaultExport: <explanation>
export default defineConfig({
testDir: "./playwright",
fullyParallel: true,
Expand Down Expand Up @@ -33,39 +37,17 @@ export default defineConfig({
},
dependencies: ["auth-setup"],
},
// {
// name: "firefox",
// use: {
// ...devices["Desktop Firefox"],
// },
// dependencies: ["auth-setup"],
// },
// {
// name: "webkit",
// use: {
// ...devices["Desktop Safari"],
// },
// dependencies: ["auth-setup"],
// },
// {
// name: "Mobile Chrome",
// use: {
// ...devices["Pixel 5"],
// },
// dependencies: ["auth-setup"],
// },
// {
// name: "Mobile Safari",
// use: {
// ...devices["iPhone 12"],
// },
// dependencies: ["auth-setup"],
// },
],

webServer: {
command: process.env.CI ? "" : "npm run start",
url: baseURL,
reuseExistingServer: true,
},
webServer: [
{
command: `anvil --fork-url=${process.env.ANVIL_FORK_URL} --fork-block-number=6373425 -m='${process.env.NEXT_PUBLIC_E2E_WALLET_MNEMONIC}'`,
port: 8545,
},
{
command: process.env.CI ? "" : "npm run start",
url: baseURL,
reuseExistingServer: true,
},
],
})
2 changes: 1 addition & 1 deletion playwright/auth.setup.ts → playwright/01-auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ setup("authenticate", async ({ page }) => {
const signInDialog = await page.getByRole("dialog", {
name: "Connect to Guild",
})
expect(signInDialog).toBeVisible()
await expect(signInDialog).toBeVisible()

await page.getByTestId("mock-connector-button").click()
await page.getByTestId("verify-address-button").click()
Expand Down
3 changes: 2 additions & 1 deletion playwright/dummy.spec.ts → playwright/02-dummy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ test("dummy", async ({ pageWithKeyPair: { page } }) => {
await page.goto("/explorer")

const accountCard = await page.getByTestId("account-card")
expect(accountCard).toBeVisible()
await expect(accountCard).toBeVisible()
accountCard.click()

await page.waitForResponse(`**/v2/users/${TEST_USER.id}/profile`)
})
29 changes: 29 additions & 0 deletions playwright/03-guild-pin.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { expect } from "@playwright/test"
import { GUILD_CHECKOUT_TEST_GUILD_URL_NAME } from "./constants"
import { test } from "./fixtures"

test("can mint guild pin", async ({ pageWithKeyPair: { page } }) => {
await page.goto(GUILD_CHECKOUT_TEST_GUILD_URL_NAME)

await page.waitForResponse("**/v2/users/*/memberships?guildId=*")

const mintGuildPinButton = await page.getByTestId("mint-guild-pin-button")
await mintGuildPinButton.click()

const mintGuildPinDialog = await page.getByRole("dialog", {
name: "Mint Guild Pin",
})
await expect(mintGuildPinDialog).toBeVisible()

const feeText = await page.getByTestId("guild-pin-fee")
await expect(feeText).toContainText("0.001 ETH")

const bigMintGuildPinButton = await page.getByTestId("big-mint-guild-pin-button")
await expect(bigMintGuildPinButton).toBeEnabled()
await bigMintGuildPinButton.click()

await page.waitForResponse("**/v2/guilds/*/pin")

const successToast = await page.getByText("Successfully minted Guild Pin!")
await expect(successToast).toBeVisible({ timeout: 30_000 })
})
8 changes: 6 additions & 2 deletions playwright/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const TEST_USER = {
id: 953897,
address: "0x304def656babc745c53782639d3cab00ace8c843",
id: 6051234,
address: "0xcb03d1acd17abaf5c6019da30c9e652bdbed459f",
} as const

export const GUILD_CHECKOUT_TEST_GUILD_URL_NAME = "guild-checkout-e2e"

export const TEST_GUILD_URL_NAME = "guild-e2e"
10 changes: 10 additions & 0 deletions public/explorerLogos/seitrace.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions public/manifest.json

This file was deleted.

9 changes: 9 additions & 0 deletions public/networkLogos/filecoin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/networkLogos/mode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/networkLogos/rootstock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/networkLogos/sei.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cfbf8f1

Please sign in to comment.