mirror of
https://github.com/fergalmoran/onearmy-community-platform.git
synced 2025-12-22 09:37:54 +00:00
fix: page link given to feedback button
This commit is contained in:
@@ -32,6 +32,36 @@ describe('[Common]', () => {
|
||||
cy.url().should('include', '/how-to')
|
||||
})
|
||||
|
||||
describe.only('[User feeback button]', () => {
|
||||
it('[Desktop]', () => {
|
||||
cy.visit('/how-to')
|
||||
cy.get('[data-cy=feedback]').should('contain', 'Report a Problem')
|
||||
cy.get('[data-cy=feedback]')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', '/how-to?sort=Newest')
|
||||
|
||||
cy.visit('/map')
|
||||
cy.get('[data-cy=feedback]')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', '/map')
|
||||
})
|
||||
|
||||
it('[Mobile]', () => {
|
||||
cy.viewport('iphone-6')
|
||||
|
||||
cy.visit('/how-to')
|
||||
cy.get('[data-cy=feedback]').should('contain', 'Problem?')
|
||||
cy.get('[data-cy=feedback]')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', '/how-to?sort=Newest')
|
||||
|
||||
cy.visit('/map')
|
||||
cy.get('[data-cy=feedback]')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', '/map')
|
||||
})
|
||||
})
|
||||
|
||||
describe('[User Menu]', () => {
|
||||
it('[By Anonymous]', () => {
|
||||
cy.step('Login and Join buttons are available')
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useLocation } from 'react-router'
|
||||
import { Button, ExternalLink } from 'oa-components'
|
||||
import { Box, Text } from 'theme-ui'
|
||||
|
||||
@@ -5,7 +7,14 @@ const FORM_URL =
|
||||
'https://onearmy.retool.com/form/c48a8f5a-4f53-4c58-adda-ef4f3cd8dee1'
|
||||
|
||||
export const StickyButton = () => {
|
||||
const href = `${FORM_URL}#page=${window.location.href}`
|
||||
const location = useLocation()
|
||||
const [page, setPage] = useState<string>(window.location.href)
|
||||
|
||||
useEffect(() => {
|
||||
setPage(window.location.href)
|
||||
}, [location])
|
||||
|
||||
const href = `${FORM_URL}#page=${page}`
|
||||
|
||||
return (
|
||||
<Box
|
||||
|
||||
Reference in New Issue
Block a user