Skip to content

Commit

Permalink
feat: authenticationAuthority validation (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickevansuk authored Jan 31, 2025
1 parent 3f7c12f commit 31cb851
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const chai = require('chai');
const { FeatureHelper } = require('../../../../helpers/feature-helper');
const { GetDatasetSite } = require('../../../../shared-behaviours');

const { IMPLEMENTED_FEATURES } = global;

FeatureHelper.describeFeature(module, {
testCategory: 'core',
testFeature: 'dataset-site',
Expand Down Expand Up @@ -32,5 +34,17 @@ function (configuration, orderItemCriteria, featureIsImplemented, logger) {
it('should include accessService.endpointUrl that does not end in a trailing "/"', () => {
chai.expect(getDatasetSite.datasetSite.body.accessService.endpointUrl).not.to.match(/\/$/g, 'a trailing /');
});

if (IMPLEMENTED_FEATURES['booking-partner-openid-authentication'] === true) {
it('should include `accessService.authenticationAuthority`, as the "booking-partner-openid-authentication" feature is "true" in the config', () => {
chakram.expect(getDatasetSite.datasetSite).to.have.schema('accessService.authenticationAuthority', {
type: 'string',
});
});
} else if (IMPLEMENTED_FEATURES['booking-partner-openid-authentication'] === false) {
it('should not include `accessService.authenticationAuthority`, as the "booking-partner-openid-authentication" feature is "false" in the config', () => {
chai.expect(getDatasetSite.datasetSite.body.accessService).to.not.have.property('authenticationAuthority');
});
}
});
});

0 comments on commit 31cb851

Please sign in to comment.