Skip to content

Commit 6b8d9a2

Browse files
author
Matt Mazzola
committed
Add workaround to compare pages by name instead of using jasmine's equal for getPages test
1 parent 1994e82 commit 6b8d9a2

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

test/test.spec.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import * as factories from '../src/factories';
1212
import { spyWpmp } from './utility/mockWpmp';
1313
import { spyHpm } from './utility/mockHpm';
1414
import { spyRouter } from './utility/mockRouter';
15+
import * as util from '../src/util';
1516

1617
declare global {
1718
interface Window {
@@ -2936,7 +2937,17 @@ describe('SDK-to-MockApp', function () {
29362937
.then(pages => {
29372938
// Assert
29382939
expect(spyApp.getPages).toHaveBeenCalled();
2939-
// expect(pages).toEqual(testData.pages);
2940+
// Workaround to compare pages
2941+
pages
2942+
.forEach(page => {
2943+
const testPage = util.find(p => p.name === page.name, testData.pages);
2944+
if (testPage) {
2945+
expect(page.name).toEqual(testPage.name);
2946+
}
2947+
else {
2948+
expect(true).toBe(false);
2949+
}
2950+
});
29402951
done();
29412952
});
29422953
});

0 commit comments

Comments
 (0)