Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #185

Merged
merged 7 commits into from
May 17, 2024
Merged

Test #185

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cypress/e2e/user-claimer/2-stress-test-claim.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ context( 'Claimer can view valid events', () => {
cy.get( 'svg[data-code]' ).invoke( 'attr', 'data-code' ).as( 'public_auth_link' ).then( f => cy.log( `Event public auth link: ${ this.public_auth_link }` ) )

} )


/*
it( 'Successfully gets 3 challenge links', function( ) {


Expand Down Expand Up @@ -116,6 +115,6 @@ context( 'Claimer can view valid events', () => {
cy.contains( 'Deletion success!' )

cy.url().should( 'eq', Cypress.config().baseUrl + '/' )
} )
} ) */

} )
4 changes: 2 additions & 2 deletions cypress/e2e/user-claimer/2-view-and-claim-w-game.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ context( 'Claimer can view valid events with game', () => {
cy.get( 'svg[data-code]' ).invoke( 'attr', 'data-code' ).as( 'event_1_public_auth_link' ).then( f => cy.log( `Event 1 public auth link: ${ this.event_1_public_auth_link }` ) )

} )

/*
it( 'Event 1: Successfully redirects to challenge link and play game', function( ) {

// Store current
Expand Down Expand Up @@ -200,7 +200,7 @@ context( 'Claimer can view valid events with game', () => {

} )

} )
} ) */

// Delete event 1
it( 'Event 1: Deletes the event when clicked', function() {
Expand Down
2 changes: 1 addition & 1 deletion functions/modules/claim.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ app.get( '/claim/:event_id/:public_auth_token', async ( req, res ) => {
// Note: this sets how long scans are valid, it is an ESSENTIAL part of this applicaion
// CI is set low so we can check if our app is performans
// Live is set longer so that users on slow networks are not penalised
const old_auth_grace_period_in_ms = 1000 * ( CI || is_test_event ? 30 : 30 )
const old_auth_grace_period_in_ms = 1000 * ( CI || is_test_event ? 60 : 60 )

// Check whether the (previous) auth token is still valid
const current_auth_is_valid = public_auth?.token == public_auth_token
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/claim_codes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useParams } from "react-router-dom"
import { dev, log } from "../modules/helpers"
import { log } from "../modules/helpers"
import { get_code_by_challenge, requestManualCodeRefresh, trackEvent } from "../modules/firebase"
import { useChallenge } from "./challenges"
import { useEffect, useState } from "react"
Expand Down Expand Up @@ -51,7 +51,7 @@ export const useClaimcodeForChallenge = ( captchaResponse, fetch_code=false ) =>

// Formulate redirect depending on claim type
log( `Generating claim link based on code ${ claim_code } and event data `, event )
let link = `${ dev ? `http://localhost:3000` : VITE_publicUrl }/#/mint/${ claim_code }/${ challenge_code }`
let link = `https://poap.xyz/claim/${ claim_code }`
if( event?.collect_emails ) link = `${ VITE_publicUrl }/#/static/claim/${ claim_code }`
if( event?.claim_base_url ) link = `${ event?.claim_base_url }${ claim_code }`

Expand Down
Loading