fix tests

This commit is contained in:
Konstantin Schaper
2020-08-07 14:17:54 +02:00
parent a99fdcef8e
commit 76b561414c
5 changed files with 62 additions and 33 deletions

View File

@@ -67,9 +67,9 @@ const withReplacements = (
);
};
const copy = (input: Object) => {
function copy<T>(input: T): T {
return JSON.parse(JSON.stringify(input));
}
};
storiesOf("Changesets", module)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
@@ -114,7 +114,10 @@ storiesOf("Changesets", module)
type: "gpg",
status: "VERIFIED",
owner: "trillian",
contacts: ["Tricia Marie McMilla <trillian@hitchhiker.com>"]
contacts: [{
name: "Tricia Marie McMilla",
mail: "trillian@hitchhiker.com"
}]
}];
return <ChangesetRow repository={repository} changeset={changeset} />;
})
@@ -125,7 +128,10 @@ storiesOf("Changesets", module)
type: "gpg",
status: "INVALID",
owner: "trillian",
contacts: ["Tricia Marie McMilla <trillian@hitchhiker.com>"]
contacts: [{
name: "Tricia Marie McMilla",
mail: "trillian@hitchhiker.com"
}]
}];
return <ChangesetRow repository={repository} changeset={changeset} />;
});

View File

@@ -79,9 +79,9 @@ const SignatureIcon: FC<Props> = ({signatures, className}) => {
signature._links?.rawKey ? <a href={signature._links.rawKey.href}>{signature.keyId}</a> : signature.keyId
}</div>
<div>{t("changeset.signatureStatus")}: {status}</div>
{signature.contacts?.length > 0 && <>
{signature.contacts && signature.contacts.length > 0 && <>
<div>{t("changeset.keyContacts")}:</div>
{signature.contacts.map(contact => <div>- {contact.name}{contact.mail && ` <${contact.mail}>`}</div>)}
{signature.contacts && signature.contacts.map(contact => <div>- {contact.name}{contact.mail && ` <${contact.mail}>`}</div>)}
</>}
</p>;
};