Skip to content

Commit 3985591

Browse files
Arup3201jcbrand
authored andcommitted
update: condition based class and tests updated
1 parent 40d5402 commit 3985591

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/plugins/controlbox/templates/loginform.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function tplAuthFields() {
8888
return html`
8989
<div class="mb-3">
9090
<label for="converse-login-jid" class="form-label">${i18n_xmpp_address}:</label>
91-
<div class="input-group">
91+
<div class="${locked_domain ? 'input-group' : ''}">
9292
<input
9393
id="converse-login-jid"
9494
?autofocus=${api.settings.get('auto_focus') ? true : false}
@@ -101,7 +101,7 @@ function tplAuthFields() {
101101
/>
102102
${locked_domain ? tplDomain(locked_domain) : ''}
103103
</div>
104-
</div>
104+
</div>
105105
${authentication !== EXTERNAL ? tplPasswordInput() : ''}
106106
${api.settings.get('show_connection_url_input') ? tplConnectionURLInput() : ''}
107107
${show_trust_checkbox ? tplTrustCheckbox(show_trust_checkbox === 'off' ? false : true) : ''}

src/plugins/controlbox/tests/login.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const u = converse.env.utils;
44

55
describe("The Login Form", function () {
66

7-
it("contains an addon when locked_domain is set",
7+
it("shows the domain name when locked_domain is set",
88
mock.initConverse(
99
['chatBoxesInitialized'],
1010
{ auto_login: false,
@@ -19,8 +19,7 @@ describe("The Login Form", function () {
1919
const addons = cbview.querySelectorAll('div.input-group');
2020
expect(addons.length).toBe(1);
2121

22-
const addon = addons[0];
23-
expect(addon.innerHTML, 'jabber.hot-chilli.eu');
22+
expect(cbview.querySelector('div.input-group').textContent, 'jabber.hot-chilli.eu');
2423
}))
2524

2625
it("contains a checkbox to indicate whether the computer is trusted or not",

0 commit comments

Comments
 (0)