Skip to content

Commit fc74a78

Browse files
authored
[W-15595110] server list template (#47)
* space when no description in server added * 4.6.8 * test fixed
1 parent 0bf363d commit fc74a78

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/ApiSummary.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/* eslint-disable lit-a11y/click-events-have-key-events */
22
/* eslint-disable no-param-reassign */
33
/* eslint-disable class-methods-use-this */
4-
import { LitElement, html } from 'lit-element';
5-
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
6-
import { AmfHelperMixin } from '@api-components/amf-helper-mixin';
7-
import markdownStyles from '@advanced-rest-client/markdown-styles/markdown-styles.js';
8-
import labelStyles from '@api-components/http-method-label/http-method-label-common-styles.js';
9-
import sanitizer from 'dompurify';
10-
import '@advanced-rest-client/arc-marked/arc-marked.js';
11-
import '@api-components/api-method-documentation/api-url.js';
12-
import styles from './Styles.js';
4+
import { LitElement, html } from "lit-element";
5+
import { unsafeHTML } from "lit-html/directives/unsafe-html.js";
6+
import { AmfHelperMixin } from "@api-components/amf-helper-mixin";
7+
import markdownStyles from "@advanced-rest-client/markdown-styles/markdown-styles.js";
8+
import labelStyles from "@api-components/http-method-label/http-method-label-common-styles.js";
9+
import sanitizer from "dompurify";
10+
import "@advanced-rest-client/arc-marked/arc-marked.js";
11+
import "@api-components/api-method-documentation/api-url.js";
12+
import styles from "./Styles.js";
1313

1414
/** @typedef {import('lit-element').TemplateResult} TemplateResult */
1515

@@ -424,7 +424,7 @@ export class ApiSummary extends AmfHelperMixin(LitElement) {
424424
const serverNameTemplate = this._serverNameTemplate(server);
425425
const serverTagsTemplate = this._serverTagsTemplate(server);
426426
const listItemClass = description ? "" : "without-description";
427-
return html`<li class=${listItemClass}>
427+
return html`<li class="server-item ${listItemClass}">
428428
${serverNameTemplate} ${uri} ${serverTagsTemplate}
429429
<arc-marked
430430
.markdown=${description}
@@ -468,7 +468,7 @@ export class ApiSummary extends AmfHelperMixin(LitElement) {
468468
this._getAmfKey(this.ns.aml.vocabularies.core.name)
469469
);
470470

471-
return html`<span class="server-name">${serverName}</span>`
471+
return html`<span class="server-name">${serverName}</span>`;
472472
}
473473

474474
/**

test/api-summary.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,11 @@ describe('ApiSummary', () => {
424424
element = await modelFixture(asyncAmf);
425425
});
426426

427-
it('should render server uri for API', () => {
428-
assert.equal(element.shadowRoot.querySelector('api-url').url, 'amqp://broker.mycompany.com');
427+
it("should render server uri for API", () => {
428+
assert.equal(
429+
element.shadowRoot.querySelector(".server-name").textContent,
430+
"production"
431+
);
429432
});
430433

431434
it('should render "API channels" message', () => {

0 commit comments

Comments
 (0)