Skip to content

Commit

Permalink
Fix failing tests (adobecom#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
narcis-radu authored Aug 25, 2023
1 parent 95eb4cc commit fe91f76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ async function checkForPageMods() {

const { env } = getConfig();
const mep = PAGE_URL.searchParams.get('mep');
if (mep !== null || (env.name !== 'prod' && (persEnabled || targetEnabled))) {
if (mep !== null || (env?.name !== 'prod' && (persEnabled || targetEnabled))) {
const { default: addPreviewToConfig } = await import('../features/personalization/add-preview-to-config.js');
persManifests = await addPreviewToConfig({
pageUrl: PAGE_URL,
Expand Down
6 changes: 5 additions & 1 deletion test/utils/richresults.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { readFile } from '@web/test-runner-commands';
import { expect } from '@esm-bundle/chai';
import sinon from 'sinon';
import { loadArea } from '../../libs/utils/utils.js';
import { loadArea, setConfig } from '../../libs/utils/utils.js';

describe('Rich Results', () => {
beforeEach(() => {
setConfig({});
});

it('add the NewsArticle rich results', async () => {
document.head.innerHTML = await readFile({ path: './mocks/head-rich-results.html' });
await loadArea(document);
Expand Down

0 comments on commit fe91f76

Please sign in to comment.