diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-20 17:45:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-20 17:45:24 -0300 |
commit | c59f9a2556731ad95ab8bd7eefe7fa8a41629834 (patch) | |
tree | 5cb60195d66cebbee0ba99e05eafe22f369a46a8 /packages/merchant-backoffice-ui/tests | |
parent | 382e66b179d6fda2598936196b2ae1b97bfab8ef (diff) | |
download | wallet-core-c59f9a2556731ad95ab8bd7eefe7fa8a41629834.tar.xz |
use translation context from web-utils, don't use match react-router since is broken
Diffstat (limited to 'packages/merchant-backoffice-ui/tests')
-rw-r--r-- | packages/merchant-backoffice-ui/tests/functions/regex.test.ts | 32 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/tests/header.test.tsx | 18 |
2 files changed, 25 insertions, 25 deletions
diff --git a/packages/merchant-backoffice-ui/tests/functions/regex.test.ts b/packages/merchant-backoffice-ui/tests/functions/regex.test.ts index 12a318c3d..d866a13a0 100644 --- a/packages/merchant-backoffice-ui/tests/functions/regex.test.ts +++ b/packages/merchant-backoffice-ui/tests/functions/regex.test.ts @@ -14,10 +14,10 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - /** - * - * @author Sebastian Javier Marchano (sebasjm) - */ +/** +* +* @author Sebastian Javier Marchano (sebasjm) +*/ import { AMOUNT_REGEX, PAYTO_REGEX } from "../../src/utils/constants.js"; @@ -29,11 +29,11 @@ describe('payto uri format', () => { 'payto://void/?amount=EUR:10.5', 'payto://ilp/g.acme.bob' ] - - test('should be valid', () => { + + it('should be valid', () => { valids.forEach(v => expect(v).toMatch(PAYTO_REGEX)) }); - + const invalids = [ // has two question marks 'payto://iban/DE75?512108001245126199?amount=EUR:200.0&message=hello', @@ -46,10 +46,10 @@ describe('payto uri format', () => { // payto:// is incomplete 'payto: //ilp/g.acme.bob' ] - - test('should not be valid', () => { + + it('should not be valid', () => { invalids.forEach(v => expect(v).not.toMatch(PAYTO_REGEX)) - }); + }); }) describe('amount format', () => { @@ -62,11 +62,11 @@ describe('amount format', () => { 'ARSCOL:10', 'THISISTHEMOTHERCOIN:1,000,000.123,123', ] - - test('should be valid', () => { + + it('should be valid', () => { valids.forEach(v => expect(v).toMatch(AMOUNT_REGEX)) }); - + const invalids = [ //no currency name ':10', @@ -79,9 +79,9 @@ describe('amount format', () => { //missing value 'USD:', ] - - test('should not be valid', () => { + + it('should not be valid', () => { invalids.forEach(v => expect(v).not.toMatch(AMOUNT_REGEX)) - }); + }); })
\ No newline at end of file diff --git a/packages/merchant-backoffice-ui/tests/header.test.tsx b/packages/merchant-backoffice-ui/tests/header.test.tsx index c917366e7..1cf2b7e6c 100644 --- a/packages/merchant-backoffice-ui/tests/header.test.tsx +++ b/packages/merchant-backoffice-ui/tests/header.test.tsx @@ -23,23 +23,23 @@ import { h } from "preact"; import { ProductList } from "../src/components/product/ProductList.js"; // See: https://github.com/preactjs/enzyme-adapter-preact-pure // import { shallow } from 'enzyme'; +import { render } from "@testing-library/preact"; import * as backend from "../src/context/config.js"; -import { render, findAllByText } from "@testing-library/preact"; -import * as i18n from "../src/context/translation.js"; +// import * as i18n from "../src/context/translation.js"; -import * as jedLib from "jed"; -const handler = new jedLib.Jed("en"); +// import * as jedLib from "jed"; +// const handler = new jedLib.Jed("en"); describe("Initial Test of the Sidebar", () => { beforeEach(() => { jest .spyOn(backend, "useConfigContext") .mockImplementation(() => ({ version: "", currency: "" })); - jest.spyOn(i18n, "useTranslationContext").mockImplementation(() => ({ - changeLanguage: () => null, - handler, - lang: "en", - })); + // jest.spyOn(i18n, "useTranslationContext").mockImplementation(() => ({ + // changeLanguage: () => null, + // handler, + // lang: "en", + // })); }); test("Product list renders a table", () => { const context = render( |