Skip to content

Commit 1cbd040

Browse files
feat(W-15520218): fix unit test
1 parent 0978d09 commit 1cbd040

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

src/ApiUrl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export class ApiUrl extends AmfHelperMixin(LitElement) {
284284

285285
_getAsyncPathTemplate() {
286286
if (this.isNotHttp && !!this._method) {
287-
return html`<div class="async-servers-path">${this.path}</div>`;
287+
return html`<div class="async-servers-path url-channel-value">${this.path}</div>`;
288288
}
289289
return '';
290290
}
@@ -299,7 +299,7 @@ export class ApiUrl extends AmfHelperMixin(LitElement) {
299299
}
300300

301301
_getAsyncServersNamesList(asyncServersNames) {
302-
return asyncServersNames.map((name) => html`<span class="async-server-name">${name}</span>`)
302+
return asyncServersNames.map((name) => html`<span class="async-server-name url-value">${name}</span>`)
303303
}
304304

305305
/**

src/Styles.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,25 +274,20 @@ api-security-documentation:last-of-type {
274274
margin-left: 0;
275275
}
276276
277-
.async-servers-names-area{
278-
flex-wrap: wrap
279-
}
280-
281277
.async-servers{
282278
margin-left: 11px;
283279
}
284280
285281
.async-servers .async-servers-path{
286-
color: var(--api-method-documentation-async-channel-name-color,#000);
287282
font-size: 20px;
288283
font-style: normal;
289284
font-weight: 400;
290285
line-height: normal;
291286
margin-top: -1px;
287+
word-break: break-all;
292288
}
293289
294290
.async-servers .async-server-names-title{
295-
color: var(--api-method-documentation-async-server-names-title-color,#414141);
296291
font-size: 14px;
297292
font-style: normal;
298293
font-weight: 400;

test/api-url.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ describe('<api-url>', () => {
148148
});
149149

150150
it('should render channel', async () => {
151-
const channel = 'Channelsmartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured'
152-
await waitUntil(() => element.shadowRoot.querySelector('.url-channel-value'));
153-
assert.equal(element.shadowRoot.querySelector('.url-channel-value').textContent, channel);
151+
const channel = 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured'
152+
await waitUntil(() => element.shadowRoot.querySelector('.async-servers-path'));
153+
assert.equal(element.shadowRoot.querySelector('.async-servers-path').textContent, channel);
154154
});
155155

156156
it('should render server', async () => {
157-
const expectedServer = 'Servermqtt://api.streetlights.smartylighting.com:{port}'
158-
await waitUntil(() => element.shadowRoot.querySelector('.url-server-value'));
159-
assert.equal(element.shadowRoot.querySelector('.url-server-value').textContent, expectedServer);
157+
const expectedServer = 'production'
158+
await waitUntil(() => element.shadowRoot.querySelector('.async-server-name'));
159+
assert.equal(element.shadowRoot.querySelector('.async-server-name').textContent, expectedServer);
160160
});
161161

162162
it('should only render url value when no operation selected', async () => {

0 commit comments

Comments
 (0)