Skip to content

Commit

Permalink
test(recommendation.cy): make recommendation and bundle test more rel…
Browse files Browse the repository at this point in the history
…iable
  • Loading branch information
chrisFrazier77 committed Dec 18, 2024
1 parent bbf8c6f commit d306e8e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 33 deletions.
11 changes: 0 additions & 11 deletions packages/snap-preact-demo/templates/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ let config: SnapTemplatesConfig = {
style: globalStyles,
overrides: {
components: {
recommendation: {
lazyRender: {
enabled: false,
},
speed: 0,
},
recommendationBundle: {
lazyRender: {
enabled: false,
},
},
noResults: {
templates: {
recommendation: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,37 @@ describe('Recommendations', () => {
config.integrations.forEach((integration) => {
describe(`${integration.label}`, () => {
describe('Setup', () => {
cy.on('window:before:load', (win) => {
win.mergeSnapConfig = {
themes: {
custom: {
extends: 'bocachica',
overrides: {
components: {
recommendation: {
lazyRender: {
enabled: false,
it('has valid config', () => {
cy.wrap(config).its('url').should('have.length.at.least', 1);

cy.on('window:before:load', (win) => {
win.mergeSnapConfig = {
themes: {
custom: {
extends: 'bocachica',
overrides: {
components: {
recommendation: {
lazyRender: {
enabled: false,
},
speed: 0,
},
speed: 0,
},
},
},
},
},
recommendation: {
default: {
Default: {
component: 'Recommendation',
theme: 'custom',
recommendation: {
default: {
Default: {
component: 'Recommendation',
theme: 'custom',
},
},
},
},
};
});
};
});

it('has valid config', () => {
cy.wrap(config).its('url').should('have.length.at.least', 1);
cy.visit(config.url);
console.log(Cypress.browser);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,35 @@ describe('BundledRecommendations', () => {
describe('Setup', () => {
it('has valid config', () => {
cy.wrap(config).its('url').should('have.length.at.least', 1);

cy.on('window:before:load', (win) => {
win.mergeSnapConfig = {
themes: {
custom: {
extends: 'bocachica',
overrides: {
components: {
recommendationBundle: {
lazyRender: {
enabled: false,
},
speed: 0,
},
},
},
},
},
recommendation: {
bundle: {
Bundle: {
component: 'RecommendationBundle',
theme: 'custom',
},
},
},
};
});

cy.visit(config.url);
console.log(Cypress.browser);
});
Expand Down Expand Up @@ -198,11 +227,27 @@ describe('BundledRecommendations', () => {

cy.on('window:before:load', (win) => {
win.mergeSnapConfig = {
themes: {
custom: {
extends: 'bocachica',
overrides: {
components: {
recommendationBundle: {
lazyRender: {
enabled: false,
},
speed: 0,
},
},
},
},
},
recommendation: {
bundle: {
Bundle: {
component: 'RecommendationBundle',
resultComponent: 'CustomResult',
theme: 'custom',
},
},
},
Expand Down

0 comments on commit d306e8e

Please sign in to comment.