Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-163449 | Unit test for code coverage for connect forms #614

Open
wants to merge 6 commits into
base: stage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
269 changes: 269 additions & 0 deletions test/features/cc-forms/forms/connect.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
import sinon from 'sinon';
import { readFile } from '@web/test-runner-commands';
import { setLibs, getLibs } from '../../../../creativecloud/scripts/utils.js';
import { expect } from '@esm-bundle/chai';
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved

const miloLibs = '/libs';
setLibs(miloLibs);
const { setConfig } = await import(`${getLibs()}/utils/utils.js`);
const CONFIG = {
stage: { odinEndpoint: 'https://stage-odin.adobe.com/' },
live: { odinEndpoint: 'https://stage-odin.adobe.com/' },
prod: { odinEndpoint: 'https://odin.adobe.com/' },
};
setConfig(CONFIG);

window.adobeIMS = {
initialized: true,
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
getProfile: () => {
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
const pr = new Promise((res) => res({ countryCode: 'US', userId: 'mathuria' }));
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
return pr;
},
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
isSignedInUser: () => true,
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
getAccessToken: () => 'token',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 2 spaces but found 1.

Suggested change
getAccessToken: () => 'token',
getAccessToken: () => 'token',

adobeid: { locale: 'en' },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 2 spaces but found 1.

Suggested change
adobeid: { locale: 'en' },
adobeid: { locale: 'en' },

};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.

Suggested change

window.adobeid = {
api_parameters: {},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 2 spaces but found 0.

Suggested change
api_parameters: {},
api_parameters: {},

locale: 'en',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 2 spaces but found 0.

Suggested change
locale: 'en',
locale: 'en',

};

window.digitalData = {};
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'data' found.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { data: { '_adobe_corpnew' : { 'digitalData' : {}}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property '_adobe_corpnew' found.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { 'data': { _adobe_corpnew : { 'digitalData' : {}}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Extra space after key '_adobe_corpnew'.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { 'data': { '_adobe_corpnew': { 'digitalData' : {}}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'digitalData' found.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { 'data': { '_adobe_corpnew' : { digitalData : {}}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Extra space after key 'digitalData'.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData': {}}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {} }}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}} }};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.

Suggested change
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}}};
window.alloy_all = { 'data': { '_adobe_corpnew' : { 'digitalData' : {}}} };


function delay(ms) {
return new Promise((res) => { setTimeout(() => { res(); }, ms); });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 2 spaces but found 4.

Suggested change
return new Promise((res) => { setTimeout(() => { res(); }, ms); });
return new Promise((res) => { setTimeout(() => { res(); }, ms); });

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 0 spaces but found 2.

Suggested change
}
}


const { default: init } = await import('../../../../creativecloud/blocks/cc-forms/cc-forms.js');

document.body.innerHTML = await readFile({ path: './mocks/connect-body.html' });
describe('ConnectTrials Form', () => {
const fetchStub = sinon.stub(window, 'fetch');
before(async () => {
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
const el = document.querySelector('.cc-forms');
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
fetchStub.callsFake((url) => {
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
let payload = {};
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
if (url.includes('countries')) {
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 8 spaces but found 10.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = { 'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'data' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {data:{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'data'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data': {'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{ 'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'countryList' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{countryList:{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'countryList'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList': {'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{ 'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'items' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{items:[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'items'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items': [{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{ '_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property '_path' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{_path:'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key '_path'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path': '/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US', 'id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'id' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US',id:'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'id'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id': 'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US', 'title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'title' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US',title:'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property '_path' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{_path:'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key '_path'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path': '/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN', 'id':'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'id' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN',id:'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'id'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id': 'IN','title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN', 'title':'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'title' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN',title:'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'title'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title': 'India','value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India', 'value':'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'value' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India',value:'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'value'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value': 'IN','isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN', 'isTop':false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'isTop' found.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN',isTop:false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <key-spacing> reported by reviewdog 🐶
Missing space before value for key 'isTop'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop': false}]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false }]}}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}] }}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]} }};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.

Suggested change
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}}};
payload = {'data':{'countryList':{'items':[{'_path':'/content/dam/acom/country/us/en/US','id':'US','title':'United States','value':'US','isTop':false},{'_path':'/content/dam/acom/country/us/en/IN','id':'IN','title':'India','value':'IN','isTop':false}]}} };

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 6 spaces but found 8.

Suggested change
}
}

if (url.includes('connectregions')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 6 spaces but found 8.

Suggested change
if (url.includes('connectregions')) {
if (url.includes('connectregions')) {

payload = {
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
"data": {
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
"formfieldvaluesList": {
suhjainadobe marked this conversation as resolved.
Show resolved Hide resolved
"items": [
{
"id": 2,
"title": "United States/Canada",
"value": "0"
},
{
"id": 0,
"title": "Asia Pacific",
"value": "20"
},
{
"id": 1,
"title": "EMEA",
"value": "10"
},
{
"id": 3,
"title": "Rest of the World",
"value": "30"
}
]
}
}
};
}
if (url.includes('timezone')) {
payload = {
"data": {
"formfieldvaluesList": {
"items": [
{
"id": 0,
"title": "(GMT-12:00) International Date Line West",
"value": "0"
},
{
"id": 1,
"title": "(GMT-11:00) Midway Island, Samoa",
"value": "1"
},
{
"id": 95,
"title": "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",
"value": "95"
}
]
}
}
};
}
if (url.includes('orgsize')) {
payload = {
"data": {
"formfieldvaluesList": {
"items": [
{
"id": 1,
"title": "10-99",
"value": "10-99"
},
{
"id": 2,
"title": "100-499",
"value": "100-499"
},
{
"id": 4,
"title": "1000-4999",
"value": "1000-4999"
},
{
"id": 0,
"title": "1-9",
"value": "1-9"
},
{
"id": 3,
"title": "500-999",
"value": "500-999"
},
{
"id": 5,
"title": "5000+",
"value": "5000+"
}
]
}
}
};
}
if (url.includes('industry')) {
payload = {
"data": {
"formfieldvaluesList": {
"items": [
{
"id": 1,
"title": "Advertising",
"value": "ADVERTISING"
},
{
"id": 40,
"title": "Agriculture & Forestry",
"value": "AGRICULTURE_AND_FORESTRY"
},
{
"id": 41,
"title": "Construction",
"value": "CONSTRUCTION"
},
{
"id": 56,
"title": "Education - Higher Ed",
"value": "EDUCATION_HIGHER_ED"
},
{
"id": 53,
"title": "Utilities",
"value": "UTILITIES"
}
]
}
}
}
}
if (url.includes('jobfunction')) {
payload = {
"data": {
"formfieldvaluesList": {
"items": [
{
"id": 1,
"title": "Accounting/Finance",
"value": "ACCOUNTING_FINANCE"
},
{
"id": 2,
"title": "Administrative Support",
"value": "ADMINISTRATIVE_SUPPORT"
},
{
"id": 66,
"title": "Training and Development",
"value": "TRAINING_AND_DEVELOPMENT"
}
]
}
}
}
}
if (url.includes('connecttrialpurchaseintent')) {
payload = {
"data": {
"formfieldvaluesList": {
"items": [
{
"id": 0,
"title": "Adobe Connect Learning",
"value": "learning"
},
{
"id": 0,
"title": "Adobe Connect Webinar",
"value": "webinars"
}
]
}
}
};
}
return Promise.resolve({
json: async () => payload,
status: 200,
ok: true,
});
});
await init(el);
await delay(1000);
});

after(() => {
fetchStub.restore();
});

it('Consent should be monitored', () => {
const checkbox1 = document.body.querySelector('#consentexplicitemail');
expect(checkbox1).to.exist;
});

it('Text patterns should be validated', () => {
const postalcode = document.body.querySelector('#postalcode');
postalcode.value = 'postal code';
postalcode.dispatchEvent(new Event('input'));
});

it('Submit check', () => {
document.body.querySelector('#email').value = 'email@gmail.com';
document.body.querySelector('#fname').value = 'val';
document.body.querySelector('#lname').value = 'val';
document.body.querySelector('#phonenumber').value = 'val';
document.body.querySelector('#orgname').value = 'val';
document.body.querySelector('#country').selectedIndex = 1;
document.body.querySelector('#state').selectedIndex = 1;
document.body.querySelector('#postalcode').value = 'val';
document.body.querySelector('#region').selectedIndex = 1;
document.body.querySelector('#timezone').selectedIndex = 1;
document.body.querySelector('#orgsize').selectedIndex = 1;
document.body.querySelector('#industry').selectedIndex = 1;
document.body.querySelector('#jobfunction').selectedIndex = 1;
document.body.querySelector('#connectpurchaseintent').selectedIndex = 1;
document.body.querySelector('#accept-agreement').checked = true;
document.body.querySelector('.cc-form-component.submit').dispatchEvent(new Event('click'));
});
});
Loading
Loading