missing tests

This commit is contained in:
Sebastian 2022-04-15 18:04:42 -03:00
parent b3b1329acf
commit 9d997280d3
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
4 changed files with 18 additions and 39 deletions

View File

@ -17,6 +17,10 @@ import { Fragment, VNode, h } from "preact";
import { useState } from "preact/hooks"; import { useState } from "preact/hooks";
export function ExchangeXmlTos({ doc }: { doc: Document }): VNode { export function ExchangeXmlTos({ doc }: { doc: Document }): VNode {
if (typeof window === "undefined") {
// in nodejs env we don't have xml api
return <div />;
}
const termsNode = doc.querySelector("[ids=terms-of-service]"); const termsNode = doc.querySelector("[ids=terms-of-service]");
if (!termsNode) { if (!termsNode) {
return ( return (

View File

@ -60,11 +60,19 @@ export const ReviewingHTML = createExample(TestedComponent, {
}); });
function toBase64(str: string): string { function toBase64(str: string): string {
return btoa( const encoded = encodeURIComponent(str).replace(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) { /%([0-9A-F]{2})/g,
function (match, p1) {
return String.fromCharCode(parseInt(p1, 16)); return String.fromCharCode(parseInt(p1, 16));
}), },
); );
if (typeof btoa === "undefined") {
//nodejs
return Buffer.from(encoded).toString("base64");
} else {
//browser
return btoa(encoded);
}
} }
export const ReviewingPDF = createExample(TestedComponent, { export const ReviewingPDF = createExample(TestedComponent, {

View File

@ -1,35 +0,0 @@
/*
This file is part of TALER
(C) 2017 Inria
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.
TALER is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import { h, VNode } from "preact";
import { useTranslationContext } from "../context/translation.js";
/**
* Return coins to own bank account.
*
* @author sebasjm
*/
/**
* Imports.
*/
export function CreateReturnCoinsPage(): VNode {
const { i18n } = useTranslationContext();
return (
<span>
<i18n.Translate>Not implemented yet.</i18n.Translate>
</span>
);
}

View File

@ -21,6 +21,8 @@
import * as popup from "./popup/index.stories.js"; import * as popup from "./popup/index.stories.js";
import * as wallet from "./wallet/index.stories.js"; import * as wallet from "./wallet/index.stories.js";
import * as mui from "./mui/index.stories.js"; import * as mui from "./mui/index.stories.js";
import * as cta from "./cta/index.stories.js";
import * as components from "./components/index.stories.js";
import { setupI18n } from "@gnu-taler/taler-util"; import { setupI18n } from "@gnu-taler/taler-util";
import { renderNodeOrBrowser } from "./test-utils.js"; import { renderNodeOrBrowser } from "./test-utils.js";
@ -40,7 +42,7 @@ function testThisStory(st: any): any {
} }
describe("render every storybook example", () => { describe("render every storybook example", () => {
[popup, wallet, mui].forEach(function testAll(st: any) { [popup, wallet, cta, mui, components].forEach(function testAll(st: any) {
if (Array.isArray(st.default)) { if (Array.isArray(st.default)) {
st.default.forEach(testAll) st.default.forEach(testAll)
} else { } else {