Skip to content

Commit

Permalink
fix datasetOverview.middleware tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rosado committed Oct 25, 2024
1 parent 2860465 commit 0a6b460
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/unit/middleware/datasetOverview.middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Dataset Overview Middleware', () => {
const res = {}

describe('pullOutDatasetSpecification', () => {
it('', () => {
it('leaves specification unchanged, and extracts the dataset specification', () => {
const reqWithSpecification = {
...req,
specification: {
Expand All @@ -26,7 +26,8 @@ describe('Dataset Overview Middleware', () => {
}
}
pullOutDatasetSpecification(reqWithSpecification, res, () => {})
expect(reqWithSpecification.specification).toEqual({ dataset: 'mock-dataset', foo: 'bar' })
expect(reqWithSpecification.specification).toEqual(reqWithSpecification.specification)
expect(reqWithSpecification.datasetSpecification).toEqual({ dataset: 'mock-dataset', foo: 'bar' })
})
})

Expand All @@ -35,7 +36,7 @@ describe('Dataset Overview Middleware', () => {
const reqWithResults = {
...req,
orgInfo: { name: 'mock-org' },
specification: { fields: [{ field: 'field1' }, { field: 'field2' }] },
datasetSpecification: { fields: [{ field: 'field1' }, { field: 'field2' }] },
columnSummary: [{ mapping_field: 'field1', non_mapping_field: 'field3' }],
entityCount: { entity_count: 10 },
sources: [
Expand Down

0 comments on commit 0a6b460

Please sign in to comment.