commit 497e6bea531efe25a8e3f4ea086cc7827a31d3e2
parent e027f49890de62b648ce6bba069ec08bc8b361a5
Author: Sebastian <sebasjm@gmail.com>
Date: Fri, 23 Apr 2021 11:44:32 -0300
updated test
Diffstat:
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/packages/frontend/tests/header.test.tsx b/packages/frontend/tests/header.test.tsx
@@ -20,7 +20,7 @@
*/
import { h } from 'preact';
-import { Sidebar } from '../src/components/menu/SideBar';
+import { ProductList } from '../src/components/product/ProductList';
// See: https://github.com/preactjs/enzyme-adapter-preact-pure
import { shallow } from 'enzyme';
import * as backend from '../src/context/backend';
@@ -29,10 +29,18 @@ describe('Initial Test of the Sidebar', () => {
beforeEach(() => {
jest.spyOn(backend, 'useConfigContext').mockImplementation(() => ({ version: '', currency: '' }));
})
- test('Sidbar renders anchors with text', () => {
-
- const context = shallow(<Sidebar instance="default" onLogout={() => {}} />);
-
- expect(context.find('a').map( a => a.text())).toEqual(["Instances", "Details", "Orders", "Inventory", "Tipping", "Log out"]);
+ test('Product list renders a table', () => {
+
+ const context = shallow(<ProductList list={[{
+ description: 'description of the product',
+ image: 'asdasda',
+ price: 'USD:10',
+ quantity: 1,
+ taxes: [{name:'VAT',tax:'EUR:1'}],
+ unit:'book',
+ }]} />);
+
+ expect(context.find('table')).toBeDefined();
+ // expect(context.find('table tr td img').map(img => img.prop('src'))).toEqual('');
});
});