Skip to content

Commit

Permalink
EES-5846 Add tests for public API doc URLs in DataSetFileApiQuickStart
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsim committed Feb 6, 2025
1 parent 43bdb04 commit cc3079a
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,53 @@ describe('DataSetFileApiQuickStart', () => {
expect(
screen.getByLabelText('GET data set summary URL'),
).toHaveDisplayValue('http://localhost:5050/v1/data-sets/api-data-set-id');
expect(
screen.getByRole('link', { name: 'Guidance: Get data set summary' }),
).toHaveAttribute(
'href',
'https://dev.statistics.api.education.gov.uk/docs/reference-v1/endpoints/GetDataSet/',
);

expect(
screen.getByLabelText('GET data set metadata URL'),
).toHaveDisplayValue(
'http://localhost:5050/v1/data-sets/api-data-set-id/meta?dataSetVersion=1.0',
);
expect(
screen.getByRole('link', { name: 'Guidance: Get data set metadata' }),
).toHaveAttribute(
'href',
'https://dev.statistics.api.education.gov.uk/docs/reference-v1/endpoints/GetDataSetMeta/',
);

expect(screen.getByLabelText('GET data set query URL')).toHaveDisplayValue(
'http://localhost:5050/v1/data-sets/api-data-set-id/query?dataSetVersion=1.0',
);
expect(
screen.getByRole('link', { name: 'Guidance: Query data set (GET)' }),
).toHaveAttribute(
'href',
'https://dev.statistics.api.education.gov.uk/docs/reference-v1/endpoints/QueryDataSetGet/',
);

expect(screen.getByLabelText('POST data set query URL')).toHaveDisplayValue(
'http://localhost:5050/v1/data-sets/api-data-set-id/query?dataSetVersion=1.0',
);
expect(
screen.getByRole('link', { name: 'Guidance: Query data set (POST)' }),
).toHaveAttribute(
'href',
'https://dev.statistics.api.education.gov.uk/docs/reference-v1/endpoints/QueryDataSetPost/',
);

expect(screen.getByLabelText('GET data set CSV URL')).toHaveDisplayValue(
'http://localhost:5050/v1/data-sets/api-data-set-id/csv?dataSetVersion=1.0',
);
expect(
screen.getByRole('link', { name: 'Guidance: Download data set as CSV' }),
).toHaveAttribute(
'href',
'https://dev.statistics.api.education.gov.uk/docs/reference-v1/endpoints/DownloadDataSetCsv/',
);
});
});

0 comments on commit cc3079a

Please sign in to comment.