mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-22 15:19:47 +02:00
fix e2e tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
describe("Profile view", () => {
|
||||
it("should load user on single relay", () => {
|
||||
it("should load a rss feed profile", () => {
|
||||
cy.visit(
|
||||
"#/u/nprofile1qqsp6hxqjatvxtesgszs8aee0fcjccxa3ef3mzjva4uv2yr5lucp6jcpzemhxue69uhhyumnd3shjtnwdaehgu3wd4hk2s8c5un"
|
||||
);
|
||||
@@ -7,4 +7,10 @@ describe("Profile view", () => {
|
||||
cy.contains("fjsmu");
|
||||
cy.contains("https://rsshub.app/pixiv/user/7569500@rsslay.nostr.moe");
|
||||
});
|
||||
|
||||
it("should load a rss feed fiatjef", () => {
|
||||
cy.visit("#/u/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft");
|
||||
|
||||
cy.contains("npub1l2vyh...3afqutajft");
|
||||
});
|
||||
});
|
||||
|
@@ -31,7 +31,7 @@ export type NostrBandProfileStats = {
|
||||
report_pubkey_count: number;
|
||||
mute_pubkey_count: number;
|
||||
followers_pubkey_count: number;
|
||||
zaps_sent: {
|
||||
zaps_sent?: {
|
||||
count: number;
|
||||
zapper_count: number;
|
||||
target_event_count: number;
|
||||
@@ -43,19 +43,7 @@ export type NostrBandProfileStats = {
|
||||
avg_msats: number;
|
||||
median_msats: number;
|
||||
};
|
||||
zaps_received: {
|
||||
count: number;
|
||||
zapper_count: number;
|
||||
target_event_count: number;
|
||||
target_pubkey_count: number;
|
||||
provider_count: number;
|
||||
msats: number;
|
||||
min_msats: number;
|
||||
max_msats: number;
|
||||
avg_msats: number;
|
||||
median_msats: number;
|
||||
};
|
||||
zaps_processed: {
|
||||
zaps_received?: {
|
||||
count: number;
|
||||
zapper_count: number;
|
||||
target_event_count: number;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { useNavigate, useOutletContext, Link as RouterLink } from "react-router-dom";
|
||||
import { useNavigate, useOutletContext } from "react-router-dom";
|
||||
import moment from "moment";
|
||||
import {
|
||||
Accordion,
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
Image,
|
||||
Link,
|
||||
Stat,
|
||||
StatArrow,
|
||||
StatGroup,
|
||||
StatHelpText,
|
||||
StatLabel,
|
||||
@@ -21,6 +20,7 @@ import {
|
||||
Text,
|
||||
useDisclosure,
|
||||
} from "@chakra-ui/react";
|
||||
import { useAsync } from "react-use";
|
||||
import { useAdditionalRelayContext } from "../../providers/additional-relay-context";
|
||||
import { useUserMetadata } from "../../hooks/use-user-metadata";
|
||||
import { embedNostrLinks, renderGenericUrl } from "../../components/embed-types";
|
||||
@@ -35,10 +35,8 @@ import { QrIconButton } from "./components/share-qr-button";
|
||||
import { UserDnsIdentityIcon } from "../../components/user-dns-identity-icon";
|
||||
import { useUserContacts } from "../../hooks/use-user-contacts";
|
||||
import { convertTimestampToDate } from "../../helpers/date";
|
||||
import { useAsync } from "react-use";
|
||||
import userTrustedStatsService from "../../services/user-trusted-stats";
|
||||
import { readablizeSats } from "../../helpers/bolt11";
|
||||
import { useSharableProfileId } from "../../hooks/use-shareable-profile-id";
|
||||
|
||||
function buildDescriptionContent(description: string) {
|
||||
let content: EmbedableContent = [description.trim()];
|
||||
@@ -153,9 +151,7 @@ export default function UserAboutTab() {
|
||||
<StatGroup gap="4" whiteSpace="pre">
|
||||
<Stat>
|
||||
<StatLabel>Following</StatLabel>
|
||||
<StatNumber as={RouterLink} to="./following">
|
||||
{contacts ? readablizeSats(contacts.contacts.length) : "Unknown"}
|
||||
</StatNumber>
|
||||
<StatNumber>{contacts ? readablizeSats(contacts.contacts.length) : "Unknown"}</StatNumber>
|
||||
{contacts && (
|
||||
<StatHelpText>Updated {moment(convertTimestampToDate(contacts.created_at)).fromNow()}</StatHelpText>
|
||||
)}
|
||||
@@ -165,21 +161,17 @@ export default function UserAboutTab() {
|
||||
<>
|
||||
<Stat>
|
||||
<StatLabel>Followers</StatLabel>
|
||||
<StatNumber as={RouterLink} to="./followers">
|
||||
{readablizeSats(stats.followers_pubkey_count)}
|
||||
</StatNumber>
|
||||
<StatNumber>{readablizeSats(stats.followers_pubkey_count) || 0}</StatNumber>
|
||||
</Stat>
|
||||
|
||||
<Stat>
|
||||
<StatLabel>Published Notes</StatLabel>
|
||||
<StatNumber as={RouterLink} to="./notes">
|
||||
{readablizeSats(stats.pub_post_count)}
|
||||
</StatNumber>
|
||||
<StatNumber>{readablizeSats(stats.pub_post_count) || 0}</StatNumber>
|
||||
</Stat>
|
||||
|
||||
<Stat>
|
||||
<StatLabel>Reactions</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.pub_reaction_count)}</StatNumber>
|
||||
<StatNumber>{readablizeSats(stats.pub_reaction_count) || 0}</StatNumber>
|
||||
</Stat>
|
||||
</>
|
||||
)}
|
||||
@@ -187,7 +179,7 @@ export default function UserAboutTab() {
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
|
||||
{stats && (
|
||||
{(stats?.zaps_sent || stats?.zaps_received) && (
|
||||
<AccordionItem>
|
||||
<h2>
|
||||
<AccordionButton>
|
||||
@@ -199,39 +191,47 @@ export default function UserAboutTab() {
|
||||
</h2>
|
||||
<AccordionPanel pb="2">
|
||||
<StatGroup gap="4" whiteSpace="pre">
|
||||
<Stat>
|
||||
<StatLabel>Zap Sent</StatLabel>
|
||||
<StatNumber>{stats.zaps_sent.count}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Total Sats Sent</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_sent.msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Avg Zap Sent</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_sent.avg_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Biggest Zap Sent</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_sent.max_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
{stats.zaps_sent && (
|
||||
<>
|
||||
<Stat>
|
||||
<StatLabel>Zap Sent</StatLabel>
|
||||
<StatNumber>{stats.zaps_sent.count}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Total Sats Sent</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_sent.msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Avg Zap Sent</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_sent.avg_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Biggest Zap Sent</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_sent.max_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Stat>
|
||||
<StatLabel>Zap Received</StatLabel>
|
||||
<StatNumber>{stats.zaps_received.count}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Total Sats Received</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_received.msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Avg Zap Received</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_received.avg_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Biggest Zap Received</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_received.max_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
{stats.zaps_received && (
|
||||
<>
|
||||
<Stat>
|
||||
<StatLabel>Zap Received</StatLabel>
|
||||
<StatNumber>{stats.zaps_received.count}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Total Sats Received</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_received.msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Avg Zap Received</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_received.avg_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
<Stat>
|
||||
<StatLabel>Biggest Zap Received</StatLabel>
|
||||
<StatNumber>{readablizeSats(stats.zaps_received.max_msats / 1000)}</StatNumber>
|
||||
</Stat>
|
||||
</>
|
||||
)}
|
||||
</StatGroup>
|
||||
<Text color="slategrey">
|
||||
Stats from{" "}
|
||||
|
@@ -37,6 +37,7 @@ const UserFollowersTab = () => {
|
||||
itemKey={(i, d) => d[i]}
|
||||
width="100%"
|
||||
height={height}
|
||||
overscanCount={10}
|
||||
>
|
||||
{FollowerItem}
|
||||
</FixedSizeList>
|
||||
|
@@ -36,6 +36,7 @@ export default function UserFollowingTab() {
|
||||
itemKey={(i, d) => d.contacts[i]}
|
||||
width="100%"
|
||||
height={height}
|
||||
overscanCount={10}
|
||||
>
|
||||
{ContactItem}
|
||||
</FixedSizeList>
|
||||
|
Reference in New Issue
Block a user