-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config empty for test wire adapter #70
Comments
@jjbennett do you have a repro we can look at? |
I created a simple repo and in doing so I found the issue to be when using a dynamic and reactive property in the config. If I hard code the Ids on line 15 and 18 then it works as expected. config is available if you change line 15 and 18 to...
|
@jjbennett sorry I wasn't able to get to this earlier, could you try your test again but wait for a few ticks on the microtask queue? Something like this: describe("c-config-issue", () => {
const mockGetRecordFirst = { "Id": "0017i00001MIvJOAA1" };
const mockGetRecordSecond = { "Id": "0017i00001MIvKdAAL" };
afterEach(() => {
while (document.body.firstChild) {
document.body.removeChild(document.body.firstChild);
}
jest.clearAllMocks();
});
test("input => result", () => {
const element = createElement("c-config-issue", {
is: Config
});
document.body.appendChild(element);
return Promise.resolve().then(() => {
ldsAdapterMock.emit(mockGetRecordFirst, (config) => {
console.log('config: ', config);
return config.recordId === "0017i00001MIvJOAA1"
});
ldsAdapterMock.emit(mockGetRecordSecond, (config) => config.recordId === "0017i00001MIvKdAAL");
expect(element.getFirstRecordId()).toBe("0017i00001MIvJOAA1");
expect(element.getSecondRecordId()).toBe("0017i00001MIvKdAAL");
});
});
}); |
I was attempting to emit getRelatedListRecords with 2 different sets of data and using the config as mentioned in #15 but the config is always an empty object. There are other reports of the config being blank on stack exchange.
The text was updated successfully, but these errors were encountered: