Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions addon/services/liveagent.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export default class LiveAgentService extends Service {
svc.settings.storageDomain = domain;
}

svc.snippetSettingsFile.extraPrechatFormDetails = extraPrechatFormDetails;
svc.snippetSettingsFile.extraPrechatInfo = extraPrechatInfo;
svc.settings.extraPrechatFormDetails = extraPrechatFormDetails;
svc.settings.extraPrechatInfo = extraPrechatInfo;

svc.init(
salesforceURL,
Expand Down
16 changes: 3 additions & 13 deletions tests/unit/services/liveagent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ module('Unit | Service | liveagent', function (hooks) {
hooks.afterEach(clear);

test('it boots', function (assert) {
assert.expect(9);
assert.expect(8);

window.embedded_svc = {
settings: {},
snippetSettingsFile: {},
init() {
assert.strictEqual(arguments.length, 6);
assert.strictEqual(arguments[0], 'test://salesforceURL');
Expand Down Expand Up @@ -48,20 +47,16 @@ module('Unit | Service | liveagent', function (hooks) {
loadingText: 'Loading',
offlineSupportMinimizedText: 'Contact Us',
prepopulatedPrechatFields: {},
});

assert.deepEqual(window.embedded_svc.snippetSettingsFile, {
extraPrechatFormDetails: [],
extraPrechatInfo: [],
});
});

test('it boots with custom options', function (assert) {
assert.expect(9);
assert.expect(8);

window.embedded_svc = {
settings: {},
snippetSettingsFile: {},
init() {
assert.strictEqual(arguments.length, 6);
assert.strictEqual(arguments[0], 'test://salesforceURL');
Expand Down Expand Up @@ -109,20 +104,16 @@ module('Unit | Service | liveagent', function (hooks) {
field: 'custom://prepopulatedPrechatFields',
},
storageDomain: 'custom://domain',
});

assert.deepEqual(window.embedded_svc.snippetSettingsFile, {
extraPrechatFormDetails: ['custom://extraPrechatFormDetails'],
extraPrechatInfo: ['custom://extraPrechatInfo'],
});
});

test('it does not boot in FastBoot', function (assert) {
assert.expect(2);
assert.expect(1);

window.embedded_svc = {
settings: {},
snippetSettingsFile: {},
init() {
assert.ok(false);
},
Expand All @@ -134,6 +125,5 @@ module('Unit | Service | liveagent', function (hooks) {
service.boot();

assert.deepEqual(window.embedded_svc.settings, {});
assert.deepEqual(window.embedded_svc.snippetSettingsFile, {});
});
});