mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-29 11:12:12 +01:00
fix e2e tests
This commit is contained in:
parent
9464e3a234
commit
dcfc011dea
@ -2,7 +2,7 @@ describe("Embeds", () => {
|
||||
describe("hashtags", () => {
|
||||
it('should handle uppercase hashtags and ","', () => {
|
||||
cy.visit(
|
||||
"/n/nevent1qqsrj5ns6wva3fcghlyx0hp7hhajqtqk3kuckp7xhhscrm4jl7futegpz9mhxue69uhkummnw3e82efwvdhk6qgswaehxw309ahx7um5wgh8w6twv5pkpt8l"
|
||||
"#/n/nevent1qqsrj5ns6wva3fcghlyx0hp7hhajqtqk3kuckp7xhhscrm4jl7futegpz9mhxue69uhkummnw3e82efwvdhk6qgswaehxw309ahx7um5wgh8w6twv5pkpt8l"
|
||||
);
|
||||
|
||||
cy.findByRole("link", { name: "#Japan" }).should("be.visible");
|
||||
@ -15,10 +15,10 @@ describe("Embeds", () => {
|
||||
describe("links", () => {
|
||||
it("embed trustless.computer links", () => {
|
||||
cy.visit(
|
||||
"/n/nevent1qqsfn2mv3pe2v7jak4r5wnyengt36t0rx26w04hgysrmtpml8jnlk5cprdmhxue69uhkvet9v3ejumn0wd68ytnzv9hxgtmdv4kk2qgawaehxw309ahx7um5wgkhqatz9emk2mrvdaexgetj9ehx2aq2wry06"
|
||||
"#/n/nevent1qqsfn2mv3pe2v7jak4r5wnyengt36t0rx26w04hgysrmtpml8jnlk5cprdmhxue69uhkvet9v3ejumn0wd68ytnzv9hxgtmdv4kk2qgawaehxw309ahx7um5wgkhqatz9emk2mrvdaexgetj9ehx2aq2wry06"
|
||||
);
|
||||
|
||||
cy.get('[href="https://trustless.computer"]').should("be.visible");
|
||||
cy.get('[href="https://trustless.computer/"]').should("be.visible");
|
||||
cy.get(
|
||||
'[href="https://mempool.space/tx/461c6f56015c94d74837b68c9d08f4b80e7db7ca1e5ac4c53d9aa8c76b667672"]'
|
||||
).should("be.visible");
|
||||
@ -26,7 +26,7 @@ describe("Embeds", () => {
|
||||
|
||||
it("embeds links", () => {
|
||||
cy.visit(
|
||||
"/n/nevent1qqsvg6kt4hl79qpp5p673g7ref6r0c5jvp4yys7mmvs4m50t30sy9dgpz9mhxue69uhkummnw3e82efwvdhk6qgjwaehxw309aex2mrp0yhxvdm69e5k7r3xlpe"
|
||||
"#/n/nevent1qqsvg6kt4hl79qpp5p673g7ref6r0c5jvp4yys7mmvs4m50t30sy9dgpz9mhxue69uhkummnw3e82efwvdhk6qgjwaehxw309aex2mrp0yhxvdm69e5k7r3xlpe"
|
||||
);
|
||||
|
||||
cy.get('[href="https://getalby.com/"]').should("exist");
|
||||
@ -38,7 +38,7 @@ describe("Embeds", () => {
|
||||
|
||||
it("embeds simplex.chat links", () => {
|
||||
cy.visit(
|
||||
"/n/nevent1qqsymds0vlpp4f5s0dckjf4qz283pdsen0rmx8lu7ct6hpnxag2hpacpremhxue69uhkummnw3ez6un9d3shjtnwda4k7arpwfhjucm0d5q3qamnwvaz7tmwdaehgu3wwa5kueghxyq76"
|
||||
"#/n/nevent1qqsymds0vlpp4f5s0dckjf4qz283pdsen0rmx8lu7ct6hpnxag2hpacpremhxue69uhkummnw3ez6un9d3shjtnwda4k7arpwfhjucm0d5q3qamnwvaz7tmwdaehgu3wwa5kueghxyq76"
|
||||
);
|
||||
|
||||
cy.get(
|
||||
@ -50,15 +50,15 @@ describe("Embeds", () => {
|
||||
describe("Nostr links", () => {
|
||||
it("should embed noub1...", () => {
|
||||
cy.visit(
|
||||
"/n/nevent1qqsd5yw7sntqfc4e7u4aempvgctry2plz653t9gpf97ctk5vc0ftskgpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3zamnwvaz7tmwdaehgun4v5hxxmmdfxdj3a"
|
||||
"#/n/nevent1qqsd5yw7sntqfc4e7u4aempvgctry2plz653t9gpf97ctk5vc0ftskgpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3zamnwvaz7tmwdaehgun4v5hxxmmdfxdj3a"
|
||||
);
|
||||
cy.contains("Alby team");
|
||||
|
||||
cy.get(".chakra-card")
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.get('[href="/u/npub13sajvl5ak6cpz4ycesl0e5v869r5sey5pt50l9mcy6uas0fqtpmscth4np"]').should("be.visible");
|
||||
cy.get('[href="/u/npub167n5w6cj2wseqtmk26zllc7n28uv9c4vw28k2kht206vnghe5a7stgzu3r"]').should("be.visible");
|
||||
cy.get('[href="#/u/npub13sajvl5ak6cpz4ycesl0e5v869r5sey5pt50l9mcy6uas0fqtpmscth4np"]').should("be.visible");
|
||||
cy.get('[href="#/u/npub167n5w6cj2wseqtmk26zllc7n28uv9c4vw28k2kht206vnghe5a7stgzu3r"]').should("be.visible");
|
||||
|
||||
// make sure the leading @ is removed
|
||||
cy.get(".chakra-card__body").should("not.contain.text", "@@");
|
||||
|
@ -1,6 +1,6 @@
|
||||
describe("Login view", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("/login");
|
||||
cy.visit("#/login");
|
||||
|
||||
cy.window().then(($win) => {
|
||||
cy.stub($win, "prompt").returns("pass");
|
||||
|
@ -1,7 +1,7 @@
|
||||
describe("Profile view", () => {
|
||||
it("should load user on single relay", () => {
|
||||
cy.visit(
|
||||
"/u/nprofile1qqsp6hxqjatvxtesgszs8aee0fcjccxa3ef3mzjva4uv2yr5lucp6jcpzemhxue69uhhyumnd3shjtnwdaehgu3wd4hk2s8c5un"
|
||||
"#/u/nprofile1qqsp6hxqjatvxtesgszs8aee0fcjccxa3ef3mzjva4uv2yr5lucp6jcpzemhxue69uhhyumnd3shjtnwdaehgu3wd4hk2s8c5un"
|
||||
);
|
||||
|
||||
cy.contains("fjsmu");
|
||||
|
@ -2,7 +2,7 @@ describe("No account", () => {
|
||||
describe("note view", () => {
|
||||
it("should fetch and render note", () => {
|
||||
cy.visit(
|
||||
"/n/nevent1qqs84hwdlls703w4yf66qsszxjqfc0xselfxrzr6n4qp40vzdnczragpr4mhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet5jcwczn"
|
||||
"#/n/nevent1qqs84hwdlls703w4yf66qsszxjqfc0xselfxrzr6n4qp40vzdnczragpr4mhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet5jcwczn"
|
||||
);
|
||||
|
||||
cy.get(".chakra-card")
|
||||
|
@ -10,7 +10,7 @@ describe("Search", () => {
|
||||
|
||||
for (const [link, regexp] of links) {
|
||||
it(`should handle ${link}`, () => {
|
||||
cy.visit("/search");
|
||||
cy.visit("#/search");
|
||||
cy.findByRole("searchbox").type(link, { delay: 0 }).type("{enter}");
|
||||
|
||||
cy.contains(regexp).should("be.visible");
|
||||
@ -20,7 +20,7 @@ describe("Search", () => {
|
||||
for (const [link, regexp] of links) {
|
||||
const withoutPrefix = link.replace("nostr:", "");
|
||||
it(`should handle ${withoutPrefix}`, () => {
|
||||
cy.visit("/search");
|
||||
cy.visit("#/search");
|
||||
cy.findByRole("searchbox").type(link, { delay: 0 }).type("{enter}");
|
||||
|
||||
cy.contains(regexp).should("be.visible");
|
||||
@ -39,7 +39,7 @@ describe("Search", () => {
|
||||
|
||||
for (const [search, regexp] of profiles) {
|
||||
it(`should handle ${search}`, () => {
|
||||
cy.visit("/search");
|
||||
cy.visit("#/search");
|
||||
cy.findByRole("searchbox").type(search, { delay: 0 }).type("{enter}");
|
||||
|
||||
cy.contains(regexp).should("be.visible");
|
||||
@ -49,7 +49,7 @@ describe("Search", () => {
|
||||
for (const [search, regexp] of profiles) {
|
||||
const withoutPrefix = search.replace("nostr:", "");
|
||||
it(`should handle ${withoutPrefix}`, () => {
|
||||
cy.visit("/search");
|
||||
cy.visit("#/search");
|
||||
cy.findByRole("searchbox").type(search, { delay: 0 }).type("{enter}");
|
||||
|
||||
cy.contains(regexp).should("be.visible");
|
||||
|
@ -4,6 +4,7 @@ import { ArrowDownSIcon, ArrowUpSIcon } from "../../components/icons";
|
||||
import { Note } from "../../components/note";
|
||||
import { countReplies, ThreadItem as ThreadItemData } from "../../helpers/thread";
|
||||
import { useIsMobile } from "../../hooks/use-is-mobile";
|
||||
import { TrustProvider } from "../../components/note/trust";
|
||||
|
||||
export type ThreadItemProps = {
|
||||
post: ThreadItemData;
|
||||
@ -20,7 +21,9 @@ export const ThreadPost = ({ post, initShowReplies, focusId }: ThreadItemProps)
|
||||
|
||||
return (
|
||||
<Flex direction="column" gap="2">
|
||||
<Note event={post.event} variant={focusId === post.event.id ? "filled" : "outline"} />
|
||||
<TrustProvider trust={focusId === post.event.id ? true : undefined}>
|
||||
<Note event={post.event} variant={focusId === post.event.id ? "filled" : "outline"} />
|
||||
</TrustProvider>
|
||||
{post.replies.length > 0 && (
|
||||
<>
|
||||
<Button variant="link" size="sm" alignSelf="flex-start" onClick={toggle}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user