Skip to content

Commit

Permalink
Clean up code by removing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Akansha Arora committed Sep 25, 2024
1 parent 4696834 commit 361168f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/features/jarvis-chat/jarvis-chat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,35 +262,29 @@ describe('Jarvis Chat', () => {
params.callbacks.onReadyCallback();
expect(openMessagingWindowSpy.called).to.be.true;
});

it('should use stage asset URL in non-prod environment', async () => {
setConfig(defaultConfig);
const config = getConfig();
config.jarvis.onDemand = false;

const loadScriptSpy = sinon.spy();
const loadStyleSpy = sinon.spy();

await initJarvisChat(config, loadScriptSpy, loadStyleSpy, sinon.stub());

const expectedAsset = 'https://stage-client.messaging.adobe.com/latest/AdobeMessagingClient';
expect(loadScriptSpy.calledWithExactly(`${expectedAsset}.js`)).to.be.true;
expect(loadStyleSpy.calledWithExactly(`${expectedAsset}.css`)).to.be.true;
});

it('should use prod asset URL in prod environment', async () => {
setConfig(defaultConfig);
const config = getConfig();
config.jarvis.onDemand = false;
config.env.name = 'prod';

const loadScriptSpy = sinon.spy();
const loadStyleSpy = sinon.spy();

await initJarvisChat(config, loadScriptSpy, loadStyleSpy, sinon.stub());

const expectedAsset = 'https://client.messaging.adobe.com/latest/AdobeMessagingClient';
expect(loadScriptSpy.calledWithExactly(`${expectedAsset}.js`)).to.be.true;
expect(loadStyleSpy.calledWithExactly(`${expectedAsset}.css`)).to.be.true;
});

});

0 comments on commit 361168f

Please sign in to comment.