Skip to content

Commit ac80d3a

Browse files
authored
[W-12528949] Fix timeout (#52)
* chore: fix timeout * chore: add timeout * chore: chage done to atimeout
1 parent 2d40ed7 commit ac80d3a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

test/api-body-document.test.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -489,17 +489,18 @@ describe('ApiBodyDocumentElement', () => {
489489
assert.typeOf(typeNode.selectedBodyId, 'string', 'selected body id is set');
490490
});
491491

492-
it('api-type-document renders api-resource-example-document element', (done) => {
492+
it('api-type-document renders api-resource-example-document element', async () => {
493493
const op = computeOperation(element, amf, '/validatecustomeraccounthash', 'post');
494494
const payload = computeReturnsPayload(element, op, '400');
495495
element.body = payload;
496-
setTimeout(() => {
497-
const typeNode = element.shadowRoot.querySelector('api-type-document');
498-
const node = typeNode.shadowRoot.querySelector('api-resource-example-document');
499-
assert.lengthOf(node.renderedExamples, 1, 'Examples render has 1 example');
500-
assert.equal(node.renderedExamples[0].title, '400_badrequest_validate_customer_account_hash');
501-
done();
502-
}, 200);
496+
await aTimeout(0);
497+
const typeNode = element.shadowRoot.querySelector('api-type-document');
498+
const node = typeNode.shadowRoot.querySelector('api-resource-example-document');
499+
await aTimeout(0);
500+
assert.lengthOf(node.renderedExamples, 1, 'Examples render has 1 example');
501+
await aTimeout(0);
502+
assert.equal(node.renderedExamples[0].title, '400_badrequest_validate_customer_account_hash');
503+
await aTimeout(0);
503504
});
504505
});
505506
});

0 commit comments

Comments
 (0)