Реагировать на проблемы с библиотекой тестирования и пользовательскими темами - PullRequest
0 голосов
/ 06 февраля 2020

У меня есть следующий тест:

  it('should render the Name component correctly', () => {
    const { asFragment } = render(
      <ThemeProvider theme={theme}>
        <Name variant="body1">Hello Test</Name>
      </ThemeProvider>
    )
    expect(asFragment()).toMatchSnapshot()
  })

const theme = createMuiTheme({
  typography: {
    fontFamily: 'Poppings'
  },
  palette: {
    primary: {
      main: primaryColor
    },
    secondary: {
      main: secondaryColor

    },
    text: {
      primary: primaryText,
      secondary: secondaryText
    }
  }
})


export const LogoutButton = styled(Button)`   ${({ theme }) => `
    text-transform: none;
    color: ${theme.palette.text.primary}
    margin-left: 2rem;
    font-size: ${fontSize}

    &:hover {
      text-decoration: underline;
      background-color: transparent;
    }   `} `

, но он не проходит, и кажется, что палитра не проходит ... Есть ли какая-либо дополнительная конфигурация для библиотеки реагирующего тестирования, чтобы можно было использовать тема?

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...