correct sort order of css properties

mocking of fetch api only once in setupTests
This commit is contained in:
2020-08-05 17:55:51 +00:00
parent 748f0410de
commit f80554bfdd
26 changed files with 155 additions and 195 deletions

View File

@@ -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 {

View File

@@ -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()