Skip to content

Commit

Permalink
test: add cypress test for ipfs agreement link
Browse files Browse the repository at this point in the history
  • Loading branch information
aahna-ashina committed Aug 27, 2024
1 parent b65bd86 commit b15709a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/components/GradientLink.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Link from 'next/link'
import React from 'react'

export default function GradientLink({ text, href, textSize }: any) {
export default function GradientLink({ id, text, href, textSize }: any) {
return (
<Link
id={id}
href={href}
className={`text-${textSize} font-medium bg-gradient-to-r from-n3blue to-n3green text-transparent bg-clip-text`}
target={(href?.charAt(0) === '/') ? "_self" : "_blank"}
Expand Down
14 changes: 14 additions & 0 deletions ui/cypress/e2e/join.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('Become a citizen', () => {

it('click agreement link', () => {
cy.visit('/join')

cy.get('#agreementLink').click();

// Expect the IPFS agreement text to be opened in a new browser window
// Expected text: "By becoming a Nation3 citizen, I hereby agree to ..."
// TO DO
})
})

export {}
1 change: 1 addition & 0 deletions ui/pages/join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default function Join() {
<br />
{nationPassportAgreementStatement}:{' '}
<GradientLink
id="agreementLink"
text="Read the terms"
href={nationPassportAgreementURI}
/>
Expand Down

0 comments on commit b15709a

Please sign in to comment.