0
陣營分量I保持收到這個錯誤而測試反應組分:錯誤而測試使用茉莉
Error: Invariant Violation: findComponentRoot(..., .0): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID ``.
碼I用於測試:
describe(`Method: flattenData`,() => {
const tests = [
{
toFlatten: {
'key1': 'k',
'key2': 'n',
'key3': 'o'
},
expectedResult: 'key1: k; key2: n; key3: o'
}
];
tests.forEach((test) => {
expect(instance.flattenData(test.toFlatten)).toEqual(test.expectedResult);
});
});
你能提供有關'instance'更多信息變量是否引用?調用'instance.flattenData'或創建組件實例時發生錯誤 –
我找到了修復程序,我沒有提供有關錯誤實例的更多數據以及實例。 flattenData在這種情況下不相關無論如何。 –