Skip to content

Commit d6e41e1

Browse files
committed
test: improve some E2E tests
1 parent 484de84 commit d6e41e1

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

src/plugins/lightning-experience-settings/index.e2e-spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ describe(LightningExperienceSettings.name, function () {
1010
configOriginal = await plugin.retrieve();
1111
});
1212

13+
const configSLDS2 = { activeThemeName: 'SalesforceCosmos' };
1314
const configLightningLite = { activeThemeName: 'LightningLite' };
15+
it('should activate SalesforceCosmos theme (SLDS2)', async () => {
16+
await plugin.run(configSLDS2);
17+
});
18+
it('SalesforceCosmos theme should already be activated', async () => {
19+
const state = await plugin.retrieve();
20+
assert.deepStrictEqual(state, configSLDS2);
21+
});
1422
it('should activate LightningLite theme', async () => {
1523
await plugin.run(configLightningLite);
1624
});

src/plugins/omni-channel-settings/index.e2e-spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ describe(OmniChannelSettings.name, function () {
1717

1818
it('should enable status based capacity model', async () => {
1919
await plugin.run(configEnableStatusBasedCapacityModel);
20+
});
21+
22+
it('should verify status based capacity model is enabled', async () => {
2023
const res = await plugin.retrieve();
2124
assert.deepStrictEqual(res, configEnableStatusBasedCapacityModel);
2225
});
2326

2427
it('should disable status based capacity model', async () => {
2528
await plugin.run(configDisableStatusBasedCapacityModel);
29+
});
30+
31+
it('should verify status based capacity model is disabled', async () => {
2632
const res = await plugin.retrieve();
2733
assert.deepStrictEqual(res, configDisableStatusBasedCapacityModel);
2834
});

src/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import assert from 'assert';
22
import { RelateContactToMultipleAccounts } from './index.js';
33

44
describe(RelateContactToMultipleAccounts.name, function () {
5+
this.timeout('5m');
56
let plugin: RelateContactToMultipleAccounts;
67
before(() => {
78
plugin = new RelateContactToMultipleAccounts(global.bf);

src/plugins/service-channels/index.e2e-spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ describe(ServiceChannels.name, function () {
3636
},
3737
},
3838
];
39+
it('should disable status based capacity model', async () => {
40+
const omnniChannelPlugin = new OmniChannelSettings(global.bf);
41+
await omnniChannelPlugin.run({ enableStatusBasedCapacityModel: false });
42+
});
3943

4044
it('should create service channel as a prerequisite', () => {
4145
const sourceDeployCmd = child.spawnSync('sf', [
@@ -59,4 +63,15 @@ describe(ServiceChannels.name, function () {
5963
const res = await plugin.retrieve(configureServiceChannels);
6064
assert.deepStrictEqual(res, configureServiceChannels);
6165
});
66+
67+
it('should delete Service Channels', async () => {
68+
const conn = global.bf.org.getConnection();
69+
const result = await conn.query("SELECT Id FROM ServiceChannel WHERE DeveloperName IN ('CaseTest', 'LeadTest')");
70+
if (result.records?.length) {
71+
await conn.delete(
72+
'ServiceChannel',
73+
result.records.map((r) => r.Id),
74+
);
75+
}
76+
});
6277
});

0 commit comments

Comments
 (0)