Skip to content

Commit

Permalink
fixes on dev (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBigBoss authored Oct 5, 2024
1 parent 1ff344e commit d721e33
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 17 deletions.
10 changes: 5 additions & 5 deletions packages/playwright/tests/fixtures/profiles/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ export class ProfilePage {
public readonly page: Page,
public readonly profile: { name: string; about: string }
) {
this.sendButton = page.getByTestId('openSendDialogButton')
this.sendButton = page.getByRole('link', { name: 'SEND' })
}

async visit(tag: string, expect?: Expect<ProfilePage>) {
await this.page.goto(`/${tag}`)
const title = await this.page.title()
expect?.(title).toBe('Send | Profile')
await expect?.(this.page.getByRole('heading', { name: tag })).toBeVisible()
await expect?.(this.page.locator('#profileName')).toHaveText(this.profile.name)
await expect?.(this.page.getByText(this.profile.about, { exact: true })).toBeVisible()
await expect?.(this.page.getByAltText(this.profile.name)).toBeVisible()
await expect?.soft(this.page.getByRole('heading', { name: tag })).toBeVisible()
await expect?.soft(this.page.locator('#profileName')).toHaveText(this.profile.name)
await expect?.soft(this.page.getByText(this.profile.about, { exact: true })).toBeVisible()
// await expect?.soft(this.page.getByAltText(this.profile.name)).toBeVisible()
}
}
24 changes: 13 additions & 11 deletions packages/playwright/tests/home.onboarded.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,21 @@ test('can visit token detail page', async ({ context, page }) => {
// @todo: Heading checks need to be refactored to mobile only
// await expect(heading(page)).toBeVisible()

await expect(page.getByText('Sent')).toBeVisible()
await expect(page.getByText('0x93F2FA7A16a7365e3895b0F6E6Ac7a832d6c761a')).toBeVisible()
await expect(page.getByText('10 USDC')).toBeVisible()
const history = page.getByTestId('TokenDetailsHistory')

await expect.soft(history.getByText('Sent')).toBeVisible()
await expect.soft(history.getByText('0x93F2FA7A16a7365e3895b0F6E6Ac7a832d6c761a')).toBeVisible()
await expect.soft(history.getByText('10 USDC')).toBeVisible()

// Button and label
await expect(page.getByText('Deposit')).toHaveCount(2)

await expect(page.getByText('/alice')).toBeVisible()
await expect(page.getByText('Received')).toBeVisible()
await expect(page.getByText('20 USDC')).toBeVisible()
await expect(page.getByText('0xa71CE00000000000000000000000000000000000')).toBeVisible()
await expect(page.getByText('30 USDC')).toBeVisible()
await expect(page.getByText('0x93F2FA7A16a7365e3895b0F6E6Ac7a832d6c761a')).toBeVisible()
await expect.soft(history.getByText('Deposit')).toHaveCount(1)

await expect.soft(history.getByText('/alice')).toBeVisible()
await expect.soft(history.getByText('Received')).toBeVisible()
await expect.soft(history.getByText('20 USDC')).toBeVisible()
await expect.soft(history.getByText('0xa71CE00000000000000000000000000000000000')).toBeVisible()
await expect.soft(history.getByText('30 USDC')).toBeVisible()
await expect.soft(history.getByText('0x93F2FA7A16a7365e3895b0F6E6Ac7a832d6c761a')).toBeVisible()

expect(page.getByTestId('TokenDetailsHistory')).toBeVisible()
// expect(await page.getByTestId('TokenDetailsHistory').textContent()).toMatchSnapshot(
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright/tests/send.onboarded.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ for (const token of coins) {
await page.goto('/')

//Press send button
await page.getByTestId('homeSendButton').click()
await page.getByTestId('homeSendButton').first().click()

// fill search input
const searchInput = page.getByRole('search', { name: 'query' })
Expand Down
125 changes: 125 additions & 0 deletions packages/snaplet/.snaplet/dataModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,117 @@
}
]
},
"affiliate_stats": {
"id": "public.affiliate_stats",
"schemaName": "public",
"tableName": "affiliate_stats",
"fields": [
{
"id": "public.affiliate_stats.paymaster_tx_count",
"name": "paymaster_tx_count",
"columnName": "paymaster_tx_count",
"type": "int8",
"isRequired": true,
"kind": "scalar",
"isList": false,
"isGenerated": false,
"sequence": false,
"hasDefaultValue": true,
"isId": false,
"maxLength": null
},
{
"id": "public.affiliate_stats.user_id",
"name": "user_id",
"columnName": "user_id",
"type": "uuid",
"isRequired": false,
"kind": "scalar",
"isList": false,
"isGenerated": false,
"sequence": false,
"hasDefaultValue": false,
"isId": false,
"maxLength": null
},
{
"id": "public.affiliate_stats.id",
"name": "id",
"columnName": "id",
"type": "uuid",
"isRequired": true,
"kind": "scalar",
"isList": false,
"isGenerated": false,
"sequence": false,
"hasDefaultValue": true,
"isId": true,
"maxLength": null
},
{
"id": "public.affiliate_stats.created_at",
"name": "created_at",
"columnName": "created_at",
"type": "timestamptz",
"isRequired": true,
"kind": "scalar",
"isList": false,
"isGenerated": false,
"sequence": false,
"hasDefaultValue": true,
"isId": false,
"maxLength": null
},
{
"id": "public.affiliate_stats.updated_at",
"name": "updated_at",
"columnName": "updated_at",
"type": "timestamptz",
"isRequired": true,
"kind": "scalar",
"isList": false,
"isGenerated": false,
"sequence": false,
"hasDefaultValue": true,
"isId": false,
"maxLength": null
},
{
"name": "profiles",
"type": "profiles",
"isRequired": false,
"kind": "object",
"relationName": "affiliate_statsToprofiles",
"relationFromFields": [
"user_id"
],
"relationToFields": [
"id"
],
"isList": false,
"isId": false,
"isGenerated": false,
"sequence": false,
"hasDefaultValue": false
}
],
"uniqueConstraints": [
{
"name": "affiliate_stats_pkey",
"fields": [
"id"
],
"nullNotDistinct": false
},
{
"name": "affiliate_stats_user_id_key",
"fields": [
"user_id"
],
"nullNotDistinct": false
}
]
},
"audit_log_entries": {
"id": "auth.audit_log_entries",
"schemaName": "auth",
Expand Down Expand Up @@ -3702,6 +3813,20 @@
"sequence": false,
"hasDefaultValue": false
},
{
"name": "affiliate_stats",
"type": "affiliate_stats",
"isRequired": false,
"kind": "object",
"relationName": "affiliate_statsToprofiles",
"relationFromFields": [],
"relationToFields": [],
"isList": true,
"isId": false,
"isGenerated": false,
"sequence": false,
"hasDefaultValue": false
},
{
"name": "referrals_referrals_referred_idToprofiles",
"type": "referrals",
Expand Down

0 comments on commit d721e33

Please sign in to comment.