correct sort order of css properties
mocking of fetch api only once in setupTests
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
.tagbtn {
|
||||
color: white;
|
||||
margin: 10px;
|
||||
background-color: #3574fe;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
padding: 5px 15px 5px 15px;
|
||||
/*font-weight: bold;*/
|
||||
color: white;
|
||||
display: block;
|
||||
margin: 10px;
|
||||
/*font-weight: bold;*/
|
||||
padding: 5px 15px 5px 15px;
|
||||
}
|
||||
|
||||
.tagbtn:focus {
|
||||
|
@@ -5,14 +5,6 @@ import "@testing-library/jest-dom"
|
||||
import {shallow} from 'enzyme'
|
||||
|
||||
describe('<Tag/>', function () {
|
||||
function prepareFetchApi(response) {
|
||||
const mockJsonPromise = Promise.resolve(response);
|
||||
const mockFetchPromise = Promise.resolve({
|
||||
json: () => mockJsonPromise,
|
||||
});
|
||||
return (jest.fn().mockImplementation(() => mockFetchPromise));
|
||||
}
|
||||
|
||||
it('renders without crashing ', function () {
|
||||
const wrapper = shallow(<Tag>test</Tag>);
|
||||
wrapper.unmount();
|
||||
@@ -24,7 +16,7 @@ describe('<Tag/>', function () {
|
||||
});
|
||||
|
||||
it('click event triggered and setvideo callback called', function () {
|
||||
global.fetch = prepareFetchApi({});
|
||||
global.fetch = global.prepareFetchApi({});
|
||||
const func = jest.fn();
|
||||
const elem = {
|
||||
changeRootElement: () => func()
|
||||
|
Reference in New Issue
Block a user