1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-18 00:56:00 +07:00

feat: update material-ui@4.x (#123)

* chore: update material-ui@4.x

* test: update test for ActionBar and TestField

* chore: add types

* chore: update types

* test: update test for Author

* chore: fixed bunch of unit test

* chore: remove unused import

* chore: remove comments

* chore: replace shallow my mount

* chore: update git hooks

* chore: fix styles

* chore: update dependencies

* chore: remove types material-ui
This commit is contained in:
Juan Picado @jotadeveloper
2019-08-31 02:02:46 -07:00
committed by GitHub
parent 376b84f8c9
commit 67d7188cf5
54 changed files with 1336 additions and 3271 deletions

View File

@@ -1,5 +1,24 @@
import React from 'react';
import { shallow } from 'enzyme';
import { mount } from 'enzyme';
import Dist from './Dist';
const mockPackageMeta = jest.fn(() => ({
latest: {
homepage: 'https://verdaccio.tld',
bugs: {
url: 'https://verdaccio.tld/bugs',
},
dist: {
tarball: 'https://verdaccio.tld/download',
},
},
}));
jest.mock('../../pages/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta: mockPackageMeta() });
},
}));
describe('<Dist /> component', () => {
beforeEach(() => {
@@ -18,14 +37,11 @@ describe('<Dist /> component', () => {
license: '',
},
};
jest.doMock('../../pages/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Dist = require('./Dist').default;
const wrapper = shallow(<Dist />);
// @ts-ignore
mockPackageMeta.mockImplementation(() => packageMeta);
const wrapper = mount(<Dist />);
expect(wrapper.html()).toMatchSnapshot();
});
@@ -41,14 +57,11 @@ describe('<Dist /> component', () => {
license: 'MIT',
},
};
jest.doMock('../../pages/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Dist = require('./Dist').default;
const wrapper = shallow(<Dist />);
// @ts-ignore
mockPackageMeta.mockImplementation(() => packageMeta);
const wrapper = mount(<Dist />);
expect(wrapper.html()).toMatchSnapshot();
});
@@ -67,14 +80,11 @@ describe('<Dist /> component', () => {
},
},
};
jest.doMock('../../pages/Version', () => ({
DetailContextConsumer: component => {
return component.children({ packageMeta });
},
}));
const Dist = require('./Dist').default;
const wrapper = shallow(<Dist />);
// @ts-ignore
mockPackageMeta.mockImplementation(() => packageMeta);
const wrapper = mount(<Dist />);
expect(wrapper.html()).toMatchSnapshot();
});
});