Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpapani committed Aug 26, 2024
1 parent 449cac8 commit dfd1100
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
5 changes: 2 additions & 3 deletions test/audits/opportunities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@

/* eslint-env mocha */

import chai from 'chai';
import { expect, use } from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import nock from 'nock';
import { opportunitiesHandler } from '../../src/opportunities/opportunities.js';
import { MockContextBuilder } from '../shared.js';
import opportunitiesData from '../fixtures/opportunitiesdata.json' assert { type: 'json' };

chai.use(sinonChai);
const { expect } = chai;
use(sinonChai);

describe('Opportunities Tests', () => {
const url = 'https://abc.com';
Expand Down
20 changes: 19 additions & 1 deletion test/fixtures/opportunitiesdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@
"type": "click",
"selector": ".abc-survey",
"value": 2111,
"targets": {
"https://abc.com/in/products/media_1c2c9e62626b7b4df13882c013438725ae05464d6.jpeg": 577,
"undefined": 1534
},
"samples": 138,
"mobileSamples": 106,
"desktopSamples": 32,
"percentage": 40.469208211143695
},
{
"type": "click",
"selector": ".abc-survey #abc-survey-next",
"value": 2160,
"targets": {
"https://abc.com/in/images/media_1c2c9e62626b7b4df13882c0134982380923890.jpeg": 141,
"https://abc.com/in/images/media_1c2c9e62626b7b4df13882c013498223987923afe.jpeg": 401,
"undefined": 1618
},
"samples": 157,
"mobileSamples": 96,
"desktopSamples": 61,
"percentage": 46.04105571847507
}
]
Expand All @@ -38,10 +51,15 @@
"type": "click",
"selector": ".account #favorites",
"value": 138,
"targets": {
"undefined": 138
},
"samples": 10,
"mobileSamples": 9,
"desktopSamples": 1,
"percentage": 8.771929824561402
}
]
}
]
}
}

0 comments on commit dfd1100

Please sign in to comment.