Skip to content

Commit

Permalink
Adding pages test case too
Browse files Browse the repository at this point in the history
  • Loading branch information
willvedd committed Nov 17, 2023
1 parent 9e37d18 commit 4e5fc57
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions test/keywordPreservation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,12 @@ describe('preserveKeywords', () => {
provider: 'twilio',
},
],
pages: [
{
name: 'error_page',
url: '##URL##/error',
},
],
};

const mockRemoteAssets = {
Expand All @@ -515,7 +521,6 @@ describe('preserveKeywords', () => {
universal_login_enabled: true,
customText: {},
},
pages: undefined, //TODO: test these cases more thoroughly
rules: null, //TODO: test these cases more thoroughly
connections: [], // Empty on remote but has local assets
actions: [
Expand Down Expand Up @@ -557,6 +562,12 @@ describe('preserveKeywords', () => {
provider: 'twilio',
},
],
pages: [
{
name: 'error_page',
url: 'https://travel0.com/error',
},
],
};

const auth0Handlers = [
Expand All @@ -581,7 +592,8 @@ describe('preserveKeywords', () => {
type: 'resourceServers',
},
{ id: 'id', identifiers: ['id', 'domain'], type: 'customDomains' },
{ id: 'id', identifiers: ['name'], type: 'guardianFactorProviders' },
{ id: 'name', identifiers: ['id', 'name'], type: 'guardianFactorProviders' },
{ id: 'id', identifiers: ['name'], type: 'pages' },
];

it('should preserve keywords when they correlate to keyword mappings', () => {
Expand All @@ -590,6 +602,7 @@ describe('preserveKeywords', () => {
remoteAssets: mockRemoteAssets,
keywordMappings: {
COMPANY_NAME: 'Travel0',
URL: 'https://trave0.com',
ALLOWED_LOGOUT_URLS: ['localhost:3000/logout', 'https://travel0.com/logout'],
ENV: 'Production',
API_MAIN_IDENTIFIER: 'https://travel0.com/api/v1',
Expand Down Expand Up @@ -617,6 +630,7 @@ describe('preserveKeywords', () => {
expected.guardianFactorProviders[0].messaging_service_sid = '##TWILIO_SID##';
expected.guardianFactorProviders[0].auth_token = '##AUTH_TOKEN##';
expected.guardianFactorProviders[0].from = '##COMPANY_NAME##';
expected.pages[0].url = '##URL##/error';
return expected;
})()
);
Expand Down

0 comments on commit 4e5fc57

Please sign in to comment.