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