test updateContent API
This commit is contained in:
parent
da3913a25e
commit
9f3b8d6399
26
ui/src/app/components/content/Content.test.js
Normal file
26
ui/src/app/components/content/Content.test.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
import { render, screen } from '@testing-library/react';
|
||||||
|
|
||||||
|
import Content from 'app/components/content/Content';
|
||||||
|
import { ContentProvider } from 'app/context/content';
|
||||||
|
import { updateContent } from 'api';
|
||||||
|
|
||||||
|
test("render Content with test context", () => {
|
||||||
|
|
||||||
|
const App = () => {
|
||||||
|
useEffect(() => {
|
||||||
|
updateContent({"cid": "test123"});
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ContentProvider>
|
||||||
|
<Content id="cid" />
|
||||||
|
</ContentProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
render(<App />);
|
||||||
|
expect(screen.queryByText("test123")).not.toBe(null);
|
||||||
|
});
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user