Skip to content

Commit

Permalink
replace 'plain' nunjucks use with our custom one
Browse files Browse the repository at this point in the history
  • Loading branch information
rosado committed Oct 1, 2024
1 parent 4341df8 commit f59d135
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions test/unit/datasetTaskListPage.test.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
import { describe, it, expect } from 'vitest'
import nunjucks from 'nunjucks'
import addFilters from '../../src/filters/filters'
import { setupNunjucks } from '../../src/serverSetup/nunjucks.js'
import { runGenericPageTests } from './generic-page.js'
import jsdom from 'jsdom'
import mocker from '../utils/mocker.js'
import { OrgDatasetTaskList } from '../../src/routes/schemas.js'

const nunjucksEnv = nunjucks.configure([
'src/views',
'src/views/check',
'src/views/submit',
'node_modules/govuk-frontend/dist/',
'node_modules/@x-govuk/govuk-prototype-components/'
], {
dev: true,
noCache: true,
watch: true
})

const datasetNameMapping = new Map()

addFilters(nunjucksEnv, { datasetNameMapping })
const nunjucks = setupNunjucks({})

describe('Dataset Task List Page', () => {
const params = mocker(OrgDatasetTaskList)
Expand Down Expand Up @@ -69,8 +54,8 @@ describe('Dataset Task List Page', () => {
})

it('renders correctly when no taskList items are passed in', () => {
const organisation = { name: 'Test Organisation', statistical_geography: '12345678' }
const dataset = { name: 'Test Dataset', dataset: 'test-dataset' }
const organisation = { name: 'Test Organisation', statistical_geography: '12345678', organisation: 'test organisation' }
const dataset = { name: 'Test Dataset', dataset: 'test-dataset', collection: 'test-dataset' }
const taskList = []

const html = nunjucks.render('organisations/datasetTaskList.html', {
Expand Down

0 comments on commit f59d135

Please sign in to comment.