Skip to content

Commit

Permalink
change back button to link (#6374)
Browse files Browse the repository at this point in the history
  • Loading branch information
chopkinsmade authored Dec 20, 2023
1 parent fe19c98 commit a8680b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/client/modules/Tasks/TaskDetails/TaskButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ import { TASK_ARCHIVE_TASK, buttonState2props } from './state'
import { GREY_3, TEXT_COLOUR } from '../../../utils/colours'

const ButtonWrapper = styled.div`
min-height: 71px;
* {
margin-left: ${SPACING.SCALE_4};
}
* {
vertical-align: baseline;
}
`

export const TaskButtons = ({ task, returnUrl }) => (
Expand Down Expand Up @@ -49,15 +53,12 @@ export const TaskButtons = ({ task, returnUrl }) => (
Edit
</Button>
)}
<Button
buttonColour={GREY_3}
buttonTextColour={TEXT_COLOUR}
as={Link}
<Link
data-test="task-back-link"
href={returnUrl ?? urls.dashboard.myTasks()}
data-test="back-button"
>
Back
</Button>
</Link>
</ButtonWrapper>
</GridRow>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Task buttons', () => {
})

it('should show the Back link to dashboard when no return url exists', () => {
assertLink('back-button', urls.dashboard.myTasks())
assertLink('task-back-link', urls.dashboard.myTasks())
})
})

Expand All @@ -52,7 +52,7 @@ describe('Task buttons', () => {
})

it('should show the Back link to dashboard when no return url exists', () => {
assertLink('back-button', urls.dashboard.myTasks())
assertLink('task-back-link', urls.dashboard.myTasks())
})
})

Expand All @@ -64,7 +64,7 @@ describe('Task buttons', () => {
})

it('should the back button with the returnUrl as the href', () => {
assertLink('back-button', 'a/b/c')
assertLink('task-back-link', 'a/b/c')
})
})
})

0 comments on commit a8680b3

Please sign in to comment.