Fix tests
This commit is contained in:
parent
fe129381a2
commit
a1506b7df1
7 changed files with 47 additions and 44 deletions
|
@ -1,6 +1,6 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"POT-Creation-Date: 2019-08-16T11:48:21.991Z\n"
|
||||
"POT-Creation-Date: 2019-08-16T13:04:24.401Z\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -23,6 +23,14 @@ msgctxt "add attribute value"
|
|||
msgid "Add Value"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/attributes/components/AttributeListPage/AttributeListPage.json
|
||||
#. [attributeListPageAddAttribute] - button
|
||||
#. defaultMessage is:
|
||||
#. Add attribute
|
||||
msgctxt "button"
|
||||
msgid "Add attribute"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/attributes/components/AttributeValues/AttributeValues.json
|
||||
#. [attributeValuesAddButton] - add attribute value button
|
||||
#. defaultMessage is:
|
||||
|
@ -239,14 +247,6 @@ msgctxt "attribute name"
|
|||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/attributes/components/AttributeListPage/AttributeListPage.json
|
||||
#. [attributeListPageNewAttribute] - button
|
||||
#. defaultMessage is:
|
||||
#. New attribute
|
||||
msgctxt "button"
|
||||
msgid "New attribute"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/attributes/components/AttributeList/AttributeList.json
|
||||
#. [AttributeListNoAttributes] - no attributes found with present filters
|
||||
#. defaultMessage is:
|
||||
|
|
|
@ -2,7 +2,7 @@ import Card from "@material-ui/core/Card";
|
|||
import CardContent from "@material-ui/core/CardContent";
|
||||
import TextField from "@material-ui/core/TextField";
|
||||
import React from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
import { useIntl } from "react-intl";
|
||||
import slugify from "slugify";
|
||||
|
||||
import CardTitle from "@saleor/components/CardTitle";
|
||||
|
|
|
@ -28,9 +28,9 @@ const AttributeListPage: React.FC<AttributeListPageProps> = ({
|
|||
>
|
||||
<Button onClick={onAdd} color="primary" variant="contained">
|
||||
<FormattedMessage
|
||||
defaultMessage="New attribute"
|
||||
defaultMessage="Add attribute"
|
||||
description="button"
|
||||
id="attributeListPageNewAttribute"
|
||||
id="attributeListPageAddAttribute"
|
||||
/>
|
||||
<AddIcon />
|
||||
</Button>
|
||||
|
|
|
@ -6,9 +6,9 @@ import urlJoin from "url-join";
|
|||
export type LocaleContextType = string;
|
||||
export const LocaleContext = React.createContext<LocaleContextType>("en");
|
||||
|
||||
const { Consumer: LocaleConsumer, Provider } = LocaleContext;
|
||||
const { Consumer: LocaleConsumer, Provider: RawLocaleProvider } = LocaleContext;
|
||||
|
||||
const LocaleProvider = ({ children }) => {
|
||||
const LocaleProvider: React.FC = ({ children }) => {
|
||||
const [localeIndex, setLocaleIndex] = React.useState(0);
|
||||
const [messages, setMessages] = React.useState({});
|
||||
|
||||
|
@ -34,9 +34,9 @@ const LocaleProvider = ({ children }) => {
|
|||
|
||||
return (
|
||||
<IntlProvider locale={locale} messages={messages} key={locale}>
|
||||
<Provider value={locale}>{children}</Provider>
|
||||
<RawLocaleProvider value={locale}>{children}</RawLocaleProvider>
|
||||
</IntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export { LocaleConsumer, LocaleProvider };
|
||||
export { LocaleConsumer, LocaleProvider, RawLocaleProvider };
|
||||
|
|
|
@ -1,28 +1,31 @@
|
|||
import React from "react";
|
||||
import { IntlProvider } from "react-intl";
|
||||
|
||||
import { LocaleProvider } from "@saleor/components/Locale";
|
||||
import { RawLocaleProvider } from "@saleor/components/Locale";
|
||||
import { Provider as DateProvider } from "../components/Date/DateContext";
|
||||
import { MessageManager } from "../components/messages";
|
||||
import ThemeProvider from "../components/Theme";
|
||||
import { TimezoneProvider } from "../components/Timezone";
|
||||
|
||||
export const Decorator = storyFn => (
|
||||
<LocaleProvider>
|
||||
<DateProvider value={+new Date("2018-08-07T14:30:44+00:00")}>
|
||||
<TimezoneProvider value="America/New_York">
|
||||
<ThemeProvider isDefaultDark={false}>
|
||||
<MessageManager>
|
||||
<div
|
||||
style={{
|
||||
padding: 24
|
||||
}}
|
||||
>
|
||||
{storyFn()}
|
||||
</div>
|
||||
</MessageManager>
|
||||
</ThemeProvider>
|
||||
</TimezoneProvider>
|
||||
</DateProvider>
|
||||
</LocaleProvider>
|
||||
<IntlProvider defaultLocale="en" locale="en">
|
||||
<RawLocaleProvider value="en">
|
||||
<DateProvider value={+new Date("2018-08-07T14:30:44+00:00")}>
|
||||
<TimezoneProvider value="America/New_York">
|
||||
<ThemeProvider isDefaultDark={false}>
|
||||
<MessageManager>
|
||||
<div
|
||||
style={{
|
||||
padding: 24
|
||||
}}
|
||||
>
|
||||
{storyFn()}
|
||||
</div>
|
||||
</MessageManager>
|
||||
</ThemeProvider>
|
||||
</TimezoneProvider>
|
||||
</DateProvider>
|
||||
</RawLocaleProvider>
|
||||
</IntlProvider>
|
||||
);
|
||||
export default Decorator;
|
||||
|
|
|
@ -6427,7 +6427,7 @@ exports[`Storyshots Views / Attributes / Attribute details create 1`] = `
|
|||
<span
|
||||
class="MuiTypography-root-id MuiTypography-h5-id CardTitle-title-id"
|
||||
>
|
||||
General Information
|
||||
General Informations
|
||||
</span>
|
||||
<div
|
||||
class="CardTitle-toolbar-id"
|
||||
|
@ -7163,7 +7163,7 @@ exports[`Storyshots Views / Attributes / Attribute details default 1`] = `
|
|||
<span
|
||||
class="MuiTypography-root-id MuiTypography-h5-id CardTitle-title-id"
|
||||
>
|
||||
General Information
|
||||
General Informations
|
||||
</span>
|
||||
<div
|
||||
class="CardTitle-toolbar-id"
|
||||
|
@ -7897,7 +7897,7 @@ exports[`Storyshots Views / Attributes / Attribute details form errors 1`] = `
|
|||
<span
|
||||
class="MuiTypography-root-id MuiTypography-h5-id CardTitle-title-id"
|
||||
>
|
||||
General Information
|
||||
General Informations
|
||||
</span>
|
||||
<div
|
||||
class="CardTitle-toolbar-id"
|
||||
|
@ -8646,7 +8646,7 @@ exports[`Storyshots Views / Attributes / Attribute details loading 1`] = `
|
|||
<span
|
||||
class="MuiTypography-root-id MuiTypography-h5-id CardTitle-title-id"
|
||||
>
|
||||
General Information
|
||||
General Informations
|
||||
</span>
|
||||
<div
|
||||
class="CardTitle-toolbar-id"
|
||||
|
@ -9321,7 +9321,7 @@ exports[`Storyshots Views / Attributes / Attribute details multiple select input
|
|||
<span
|
||||
class="MuiTypography-root-id MuiTypography-h5-id CardTitle-title-id"
|
||||
>
|
||||
General Information
|
||||
General Informations
|
||||
</span>
|
||||
<div
|
||||
class="CardTitle-toolbar-id"
|
||||
|
@ -10055,7 +10055,7 @@ exports[`Storyshots Views / Attributes / Attribute details no values 1`] = `
|
|||
<span
|
||||
class="MuiTypography-root-id MuiTypography-h5-id CardTitle-title-id"
|
||||
>
|
||||
General Information
|
||||
General Informations
|
||||
</span>
|
||||
<div
|
||||
class="CardTitle-toolbar-id"
|
||||
|
@ -10709,7 +10709,7 @@ exports[`Storyshots Views / Attributes / Attribute list default 1`] = `
|
|||
<span
|
||||
class="MuiButton-label-id"
|
||||
>
|
||||
Add attribute
|
||||
Add attribute
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
|
@ -11434,7 +11434,7 @@ exports[`Storyshots Views / Attributes / Attribute list loading 1`] = `
|
|||
<span
|
||||
class="MuiButton-label-id"
|
||||
>
|
||||
Add attribute
|
||||
Add attribute
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
|
@ -11700,7 +11700,7 @@ exports[`Storyshots Views / Attributes / Attribute list no data 1`] = `
|
|||
<span
|
||||
class="MuiButton-label-id"
|
||||
>
|
||||
Add attribute
|
||||
Add attribute
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
|
|
|
@ -11,7 +11,7 @@ const props: AttributeBulkDeleteDialogProps = {
|
|||
onClose: () => undefined,
|
||||
onConfirm: () => undefined,
|
||||
open: true,
|
||||
quantity: "5"
|
||||
quantity: 5
|
||||
};
|
||||
|
||||
storiesOf("Attributes / Delete multiple attributes", module)
|
||||
|
|
Loading…
Reference in a new issue