Skip to content

Commit 1053bf9

Browse files
test unit fix
1 parent c9491a0 commit 1053bf9

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

demo/standalone/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ApicApplication extends DemoBase {
2525
['multi-server', 'OAS multi server'],
2626
['async-api', 'AsyncAPI'],
2727
['APIC-560', 'AsyncAPI560'],
28+
['APIC-570', 'AsyncAPI570'],
2829
];
2930
}
3031

test/api-console-documentation.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('API Console documentation', () => {
140140
await waitUntil(() => Boolean(documentationSummary(element)));
141141
const summaryShadowRoot = documentationSummary(element).shadowRoot;
142142
await waitUntil(() => Boolean(summaryShadowRoot.querySelector('.api-title')));
143-
assert.equal(summaryShadowRoot.querySelector('.api-title').textContent.trim(), 'API title:\n Google Drive');
143+
assert.equal(summaryShadowRoot.querySelector('.api-title span').textContent.trim(), 'Google Drive');
144144

145145
await waitUntil(() => Boolean(summaryShadowRoot.querySelector('.inline-description.version')));
146146
assert.equal(summaryShadowRoot.querySelector('.inline-description.version').textContent.trim(), 'Version:\n v2');
@@ -833,8 +833,8 @@ describe('API Console documentation', () => {
833833
it('should render URL', async () => {
834834
await waitUntil(() => Boolean(docShadowRoot.querySelector('api-url')));
835835
const apiUrl = docShadowRoot.querySelector('api-url').shadowRoot;
836-
assert.equal(apiUrl.querySelector('.url-channel-value').innerText.trim(), 'Channel\nsmartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured');
837-
assert.equal(apiUrl.querySelector('.url-server-value').innerText.trim(), 'Server\nmqtt://api.streetlights.smartylighting.com:{port}');
836+
assert.equal(apiUrl.querySelector('.url-channel-value').innerText.trim(), 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured');
837+
assert.equal(apiUrl.querySelector('.async-server-name').innerText.trim(), 'production');
838838
});
839839

840840
it('should render description', async () => {
@@ -865,8 +865,8 @@ describe('API Console documentation', () => {
865865
it('should render URL', async () => {
866866
await waitUntil(() => Boolean(docShadowRoot.querySelector('api-url')));
867867
const apiUrl = docShadowRoot.querySelector('api-url').shadowRoot;
868-
assert.equal(apiUrl.querySelector('.url-channel-value').innerText.trim(), 'Channelsmartylighting/streetlights/1/0/action/{streetlightId}/turn/on');
869-
assert.equal(apiUrl.querySelector('.url-server-value').innerText.trim(), 'Servermqtt://api.streetlights.smartylighting.com:{port}');
868+
assert.equal(apiUrl.querySelector('.url-channel-value').innerText.trim(), 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on');
869+
assert.equal(apiUrl.querySelector('.async-server-name').innerText.trim(), 'production');
870870
});
871871

872872
it('should render methods', async () => {

test/api-console.amf.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,11 @@ describe('ApiConsole', () => {
391391
await aTimeout(0);
392392
});
393393

394-
it('should not prefix URL with `http://', () => {
394+
it('should render server name', () => {
395395
const documentation = element.shadowRoot.querySelector('api-documentation');
396396
const summary = documentation.shadowRoot.querySelector('api-summary');
397-
const apiUrl = summary.shadowRoot.querySelector('api-url');
398-
assert.isFalse(apiUrl.url.startsWith('http') || apiUrl.url.startsWith('https'));
397+
const serverName = summary.shadowRoot.querySelector('.server-name');
398+
assert.equal(serverName.textContent, 'production');
399399
});
400400
});
401401
});
@@ -490,7 +490,7 @@ describe('ApiConsole', () => {
490490
const methodDocumentation = documentation.shadowRoot.querySelector('api-method-documentation');
491491
const apiUrl = methodDocumentation.shadowRoot.querySelector('api-url');
492492
assert.exists(apiUrl.shadowRoot.querySelector('.url-channel-value'));
493-
assert.exists(apiUrl.shadowRoot.querySelector('.url-server-value'));
493+
assert.exists(apiUrl.shadowRoot.querySelector('.async-server-name'));
494494
});
495495
});
496496
});

0 commit comments

Comments
 (0)