gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant-backoffice] branch master updated: fix test checking the


From: gnunet
Subject: [taler-merchant-backoffice] branch master updated: fix test checking the wrong thing
Date: Fri, 25 Jun 2021 17:26:34 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository merchant-backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new 2342eec  fix test checking the wrong thing
2342eec is described below

commit 2342eec8dc94a3d8a70aae240bed3112f6c56534
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Jun 25 12:26:05 2021 -0300

    fix test checking the wrong thing
---
 packages/frontend/src/components/form/InputArray.tsx |  2 --
 packages/frontend/tests/stories.test.tsx             | 15 ++++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/packages/frontend/src/components/form/InputArray.tsx 
b/packages/frontend/src/components/form/InputArray.tsx
index 9f16cbf..984c6dc 100644
--- a/packages/frontend/src/components/form/InputArray.tsx
+++ b/packages/frontend/src/components/form/InputArray.tsx
@@ -39,8 +39,6 @@ export function InputArray<T>({ name, readonly, placeholder, 
tooltip, label, hel
 
   const error = localError || formError
 
-  console.log(formError, localError)
-
   const array: any[] = (value ? value! : []) as any;
   const [currentValue, setCurrentValue] = useState('');
   const i18n = useTranslator();
diff --git a/packages/frontend/tests/stories.test.tsx 
b/packages/frontend/tests/stories.test.tsx
index 996aebb..c8a7f80 100644
--- a/packages/frontend/tests/stories.test.tsx
+++ b/packages/frontend/tests/stories.test.tsx
@@ -20,7 +20,8 @@
 */
 import { mount } from 'enzyme';
 import { h } from 'preact';
-import * as ctx from '../src/context/config';
+import * as config from '../src/context/config';
+import * as i18n from '../src/context/translation';
 
 import fs from 'fs';
 
@@ -39,11 +40,15 @@ function getFiles(dir: string, files_: string[] = []) {
 
 const re = RegExp('.*\.stories.tsx')
 
+import * as jedLib from "jed";
+const handler = new jedLib.Jed('en');
+
 it('render every story', () => {
-  jest.spyOn(ctx, 'useConfigContext').mockImplementation(() => ({ version: 
'1.0.0', currency: 'EUR' }));
+  jest.spyOn(config, 'useConfigContext').mockImplementation(() => ({ version: 
'1.0.0', currency: 'EUR' }));
+  jest.spyOn(i18n, 'useTranslationContext').mockImplementation(() => ({ 
changeLanguage: () => null, handler, lang: 'en' }));
 
   getFiles('./src').filter(f => re.test(f)).map(f => {
-
+  // const f = "./src/paths/instance/transfers/list/List.stories.tsx";
     // eslint-disable-next-line @typescript-eslint/no-var-requires
     const s = require(`../${f}`)
 
@@ -51,8 +56,8 @@ it('render every story', () => {
     Object.keys(s).forEach(k => {
       const Component = s[k];
       expect(() => {
-        mount(<Component {...Component.args} />);
-      }).not.toThrow(`problem rendering ${f} example ${k}`)
+        mount(<Component {...Component.args} />).mount().unmount().mount();
+      }).not.toThrow() //`problem rendering ${f} example ${k}`
 
     })
   })

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]