Skip to content

Commit d1848c2

Browse files
committed
test: show only url when no operation
1 parent ba363f2 commit d1848c2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/api-url.test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('<api-url>', function () {
131131

132132
beforeEach(async () => {
133133
const endpointName = 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured'
134-
const [endpoint, operation] = AmfLoader.lookupEndpointOperation(amf, endpointName, 'subscribe');
134+
const [endpoint, operation] = AmfLoader.lookupEndpointOperation(amf, endpointName, 'kafka');
135135
element = await basicFixture();
136136
element.amf = amf;
137137
server = AmfLoader.getEncodes(amf)[element._getAmfKey(element.ns.aml.vocabularies.apiContract.server)];
@@ -152,6 +152,17 @@ describe('<api-url>', function () {
152152
const server = 'Servermqtt://api.streetlights.smartylighting.com:{port}'
153153
assert.equal(element.shadowRoot.querySelector('.url-server-value').textContent, server);
154154
});
155+
156+
it('should only render url value when no operation selected', async () => {
157+
element.amf = amf
158+
element.operation = undefined
159+
element.endpoint = undefined
160+
await nextFrame();
161+
await nextFrame();
162+
163+
const url = 'mqtt://api.streetlights.smartylighting.com:{port}'
164+
assert.equal(element.shadowRoot.querySelector('.url-value').textContent.trim(), url);
165+
});
155166
});
156167
});
157168
});

0 commit comments

Comments
 (0)