-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from digital-land/backButtons
Back buttons
- Loading branch information
Showing
13 changed files
with
69 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { Controller } = require('hmpo-form-wizard') | ||
|
||
class MyController extends Controller { | ||
locals (req, res, callback) { | ||
req.form.options.lastPage = req.journeyModel.get('lastVisited') | ||
super.locals(req, res, callback) | ||
} | ||
} | ||
|
||
module.exports = MyController |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict' | ||
|
||
const MyController = require('./MyController.js') | ||
|
||
class DataSubjectController extends MyController { | ||
|
||
} | ||
|
||
module.exports = DataSubjectController |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test.use({ javaScriptEnabled: false }) | ||
|
||
test.describe('Back buttons work as expected without js for', () => { | ||
test('data subject page', async ({ page, baseURL }) => { | ||
await page.goto('/') | ||
await page.click('text=Start now') | ||
await page.getByRole('link', { name: 'Back', exact: true }).click() | ||
expect(page.url()).toBe(baseURL + '/') | ||
}) | ||
|
||
test('dataset page', async ({ page, baseURL }) => { | ||
await page.goto('/') | ||
await page.click('text=Start now') | ||
await page.getByLabel('Conservation area').check() | ||
await page.getByRole('button', { name: 'Continue' }).click() | ||
await page.getByRole('link', { name: 'Back', exact: true }).click() | ||
expect(page.url()).toBe(baseURL + '/data-subject') | ||
}) | ||
|
||
test('upload page', async ({ page, baseURL }) => { | ||
await page.goto('/') | ||
await page.click('text=Start now') | ||
await page.getByLabel('Conservation area').check() | ||
await page.getByRole('button', { name: 'Continue' }).click() | ||
await page.getByLabel('Conservation area dataset').check() | ||
await page.getByRole('button', { name: 'Continue' }).click() | ||
await page.getByRole('link', { name: 'Back', exact: true }).click() | ||
expect(page.url()).toBe(baseURL + '/dataset') | ||
}) | ||
}) |