diff --git a/package.json b/package.json index fa2dc8a187..fe591a8bd2 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-inspector": "5.1.1", - "react-markdown": "4.3.1", "react-redux": "7.2.6", "react-remove-scroll": "^2.5.5", "react-router-dom": "6.6.2", diff --git a/src/assets/images/connecting-data-in-progress.svg b/src/assets/images/connecting-data-in-progress.svg deleted file mode 100644 index 3d63570e89..0000000000 --- a/src/assets/images/connecting-data-in-progress.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/Banners/UpdateMessage.jsx b/src/components/Banners/UpdateMessage.jsx deleted file mode 100644 index f72691fd4c..0000000000 --- a/src/components/Banners/UpdateMessage.jsx +++ /dev/null @@ -1,66 +0,0 @@ -import React, { useState, useCallback } from 'react' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' -import Button from 'cozy-ui/transpiled/react/deprecated/Button' -import Infos from 'cozy-ui/transpiled/react/deprecated/Infos' -import Typography from 'cozy-ui/transpiled/react/Typography' -import PropTypes from 'prop-types' -import { useClient } from 'cozy-client' -import Intents from 'cozy-interapp' - -const UpdateMessage = props => { - const [isRedirecting, setIsRedirecting] = useState(false) - const { t } = useI18n() - const { isBlocking, konnector } = props - const client = useClient() - const intents = new Intents({ client }) - const handleRedirectToStore = useCallback(async () => { - setIsRedirecting(true) - - try { - await intents.redirect('io.cozy.apps', { - slug: konnector.slug, - step: 'update' - }) - } catch (error) { - /* eslint-disable-next-line no-console */ - console.error(error) - setIsRedirecting(false) - } - }, [konnector]) - - return ( - - - {t('update.title')} - - - {isBlocking ? t('update.blocking') : t('update.regular')} - - > - } - action={ - - } - /> - ) -} - -UpdateMessage.propTypes = { - konnector: PropTypes.object.isRequired, - isBlocking: PropTypes.bool -} - -export default UpdateMessage diff --git a/src/components/DescriptionContent.jsx b/src/components/DescriptionContent.jsx deleted file mode 100644 index 597d08457c..0000000000 --- a/src/components/DescriptionContent.jsx +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react' -import classNames from 'classnames' - -import ReactMarkdownWrapper from 'components/ReactMarkdownWrapper' -import styles from 'styles/descriptionContent.styl' - -export const DescriptionContent = ({ - cssClassesObject, - title, - messages, - children, - hasError, - centerTitle -}) => { - return ( - - {title && ( - - {title} - - )} - {messages && - messages.length > 0 && - messages.map((m, i) => { - return m ? ( - - - - ) : null - })} - {children} - - ) -} - -export default DescriptionContent diff --git a/src/components/KonnectorErrors.jsx b/src/components/KonnectorErrors.jsx deleted file mode 100644 index 1322c73324..0000000000 --- a/src/components/KonnectorErrors.jsx +++ /dev/null @@ -1,212 +0,0 @@ -import PropTypes from 'prop-types' -import React from 'react' -import flow from 'lodash/flow' -import keyBy from 'lodash/keyBy' -import { connect } from 'react-redux' -import { useClient, models } from 'cozy-client' -import { useNavigate } from 'react-router-dom' - -import AppIcon from 'cozy-ui/transpiled/react/AppIcon' -import Button from 'cozy-ui/transpiled/react/deprecated/Button' -import CrossButton from 'cozy-ui/transpiled/react/Icons/Cross' -import Divider from 'cozy-ui/transpiled/react/Divider' -import Icon from 'cozy-ui/transpiled/react/Icon' -import IconButton from 'cozy-ui/transpiled/react/IconButton' -import Infos from 'cozy-ui/transpiled/react/deprecated/Infos' -import InfosCarrousel from 'cozy-ui/transpiled/react/deprecated/InfosCarrousel' -import Typography from 'cozy-ui/transpiled/react/Typography' -import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints' -import { Media, Bd } from 'cozy-ui/transpiled/react/deprecated/Media' -import { getErrorLocaleBound, KonnectorJobError } from 'cozy-harvest-lib' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -import { - getAccountsWithErrors, - getInstalledKonnectors, - getTriggersInError -} from 'reducers/index' -import ReactMarkdownWrapper from 'components/ReactMarkdownWrapper' -import homeConfig from 'config/home.json' - -const { - triggers: { triggers: triggersModel, triggerStates: triggerStatesModel }, - accounts: accountsModel -} = models - -const muteTrigger = async (client, trigger, accountsById) => { - const accountId = triggersModel.getAccountId(trigger) - const initialAccount = accountsById[accountId] - const errorType = triggerStatesModel.getLastErrorType(trigger) - const account = accountsModel.muteError(initialAccount, errorType) - - await client.save(account) -} - -const getKonnectorSlug = konnector => konnector.slug - -// TODO, use directly Infos prop dismissAction when -// https://github.com/cozy/cozy-ui/pull/1724 is merged -// Here we need the aria-label for tests, and IconButton for style -const InfosDismissButton = ({ onClick }) => { - const { t } = useI18n() - return ( - - - - ) -} - -const dismissButtonStyle = { - position: 'absolute', - top: '0.5rem', - right: '0.5rem' -} - -const KonnectorError = ({ - trigger, - triggerErrors, - index, - konnectorsBySlug, - accountsById -}) => { - const client = useClient() - const { t, lang } = useI18n() - const { isMobile } = useBreakpoints() - const errorType = triggerStatesModel.getLastErrorType(trigger) - const konnError = new KonnectorJobError(errorType) - const konnectorSlug = triggersModel.getKonnector(trigger) - const konnectorAccount = triggersModel.getAccountId(trigger) - const konnector = konnectorsBySlug[konnectorSlug] - const navigate = useNavigate() - - const errorTitle = getErrorLocaleBound(konnError, konnector, lang, 'title') - - const errorDescription = getErrorLocaleBound( - konnError, - konnector, - lang, - 'description' - ) - - const handleDismiss = () => { - muteTrigger(client, trigger, accountsById) - } - - return ( - - - - - - - {konnector.name} - - - {triggerErrors.length > 1 - ? `(${index + 1}/${triggerErrors.length}) ` - : null} - {errorTitle} - - - - - - - - - > - } - action={ - - navigate(`/connected/${konnectorSlug}/accounts/${konnectorAccount}`) - } - /> - } - /> - ) -} - -export const KonnectorErrors = ({ - triggersInError, - accountsWithErrors, - installedKonnectors -}) => { - const { t } = useI18n() - const accountsWithErrorsById = keyBy(accountsWithErrors, '_id') - const installedKonnectorsBySlug = keyBy(installedKonnectors, getKonnectorSlug) - const nonMutedTriggerErrors = triggersInError.filter(trigger => { - const errorType = triggerStatesModel.getLastErrorType(trigger) - const accountId = triggersModel.getAccountId(trigger) - const account = accountsWithErrorsById[accountId] - const konnectorSlug = triggersModel.getKonnector(trigger) - const hasInstalledKonnector = - installedKonnectors && - installedKonnectors.some(({ slug }) => slug === konnectorSlug) - - return ( - homeConfig.displayedErrorTypes.includes(errorType) && - hasInstalledKonnector && - account && - !triggersModel.isLatestErrorMuted(trigger, account) - ) - }) - - return nonMutedTriggerErrors.length > 0 ? ( - - - {nonMutedTriggerErrors.map((trigger, index) => ( - - ))} - - - ) : ( - - {t('connector.title')} - - ) -} - -KonnectorErrors.propTypes = { - accountsWithErrors: PropTypes.array.isRequired, - installedKonnectors: PropTypes.arrayOf(PropTypes.object.isRequired), - triggersInError: PropTypes.array.isRequired -} - -const mapStateToProps = state => { - return { - accountsWithErrors: getAccountsWithErrors(state), - installedKonnectors: getInstalledKonnectors(state), - triggersInError: getTriggersInError(state) - } -} - -export default flow(connect(mapStateToProps))(KonnectorErrors) diff --git a/src/components/KonnectorInstall.jsx b/src/components/KonnectorInstall.jsx deleted file mode 100644 index fcfb990c56..0000000000 --- a/src/components/KonnectorInstall.jsx +++ /dev/null @@ -1,97 +0,0 @@ -import React, { Component } from 'react' -import { connect } from 'react-redux' - -import { IntentTriggerManager } from 'cozy-harvest-lib' -import { translate } from 'cozy-ui/transpiled/react/providers/I18n' - -import KonnectorSuccess from 'components/KonnectorSuccess' -import { getKonnector } from 'ducks/konnectors' -import styles from 'styles/konnectorInstall.styl' - -const vaultUnlockFormProps = { useAllAvailableSpace: true } - -export class KonnectorInstall extends Component { - constructor(props) { - super(props) - this.state = { - trigger: null, - success: false - } - this.handleLoginSuccess = this.handleLoginSuccess.bind(this) - this.handleSuccess = this.handleSuccess.bind(this) - } - - handleLoginSuccess(trigger) { - this.setState({ - trigger, - success: true - }) - - this.props.onLoginSuccess(trigger) - } - - handleSuccess(trigger) { - this.setState({ - trigger, - success: true - }) - - this.props.onSuccess(trigger) - } - - render() { - const { - account, - konnector, - legacySuccess, - onDone, - successMessage, - successMessages, - successButtonLabel, - t, - onCancel - } = this.props - - const { trigger, success } = this.state - - if (success || legacySuccess) { - return ( - - ) - } - - return ( - - - - {t('account.config.title', { name: konnector.name })} - - - - - ) - } -} - -const mapStateToProps = (state, ownProps) => ({ - konnector: getKonnector(state.cozy, ownProps.connector.slug) -}) - -export default translate()(connect(mapStateToProps)(KonnectorInstall)) diff --git a/src/components/KonnectorMaintenance.jsx b/src/components/KonnectorMaintenance.jsx deleted file mode 100644 index 04360e905b..0000000000 --- a/src/components/KonnectorMaintenance.jsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react' - -import ReactMarkdownWrapper from 'components/ReactMarkdownWrapper' - -import styles from 'styles/konnectorMaintenance.styl' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -const KonnectorMaintenance = ({ maintenance, lang, konnectorName }) => { - const { t } = useI18n() - - return ( - - - - - {t('maintenance.service')} - - - {t('maintenance.problem', { konnectorName })} - - - {t('maintenance.title')} - - - ) -} - -export default KonnectorMaintenance diff --git a/src/components/KonnectorSuccess.jsx b/src/components/KonnectorSuccess.jsx deleted file mode 100644 index fb3fce792d..0000000000 --- a/src/components/KonnectorSuccess.jsx +++ /dev/null @@ -1,153 +0,0 @@ -import classNames from 'classnames' -import has from 'lodash/has' -import sortBy from 'lodash/sortBy' -import React, { Component } from 'react' -import PropTypes from 'prop-types' - -import Button from 'cozy-ui/transpiled/react/deprecated/Button' -import { translate } from 'cozy-ui/transpiled/react/providers/I18n' - -import styles from 'styles/konnectorSuccess.styl' -import DescriptionContent from 'components/DescriptionContent' -import TriggerFolderLink from 'components/TriggerFolderLink' -import BanksLink from 'components/BanksLink' -import connectingIllu from 'assets/images/connecting-data-in-progress.svg' - -const SuccessImage = () => ( - - - -) - -const SuccessLinks = ({ children }) => ( - - {children} - -) - -const DriveLink = translate()(({ folderId, t }) => ( - -)) - -const SuccessFooter = translate()(({ children }) => ( - - {children} - -)) - -export class KonnectorSuccess extends Component { - componentDidMount() { - if (typeof this.props.handleConnectionSuccess === 'function') { - this.props.handleConnectionSuccess() - } - } - - render() { - const { account, error, title, messages } = this.props - const relatedApps = sortBy( - Object.values(KonnectorSuccess.apps).filter(app => - app.predicate(this.props) - ), - app => -app.priority - ) - - const hasLinks = relatedApps.length > 0 - - return ( - account && ( - - {!error && } - - {hasLinks && ( - - {relatedApps.map((app, i) => - // Should always pass context, since it's used for customisation - app.successLink(this.props, this.context, i) - )} - - )} - - - - {relatedApps.length > 0 - ? // Should always pass context, since it's used for customisation - relatedApps[0].footerLink(this.props, this.context) - : null} - - - ) - ) - } -} - -KonnectorSuccess.apps = { - drive: { - priority: 1, - // eslint-disable-next-line react/display-name - predicate: props => { - const trigger = props.trigger - const res = has(trigger, 'message.folder_to_save') - return res - }, - // eslint-disable-next-line react/display-name - successLink: (props, context, i) => { - return ( - - ) - }, - // eslint-disable-next-line react/display-name - footerLink: props => { - const { t, onDone, account, successButtonLabel } = props - return ( - { - event.preventDefault() - onDone(account) - }} - /> - ) - } - }, - - banks: { - priority: 0, - // eslint-disable-next-line react/display-name - predicate: props => { - const connector = props.connector - return ( - Array.isArray(connector.data_types) && - connector.data_types.includes('bankAccounts') - ) - }, - // eslint-disable-next-line react/display-name - successLink: (props, context, i) => { - return - }, - footerLink: () => null - } -} - -KonnectorSuccess.contextTypes = { - store: PropTypes.object -} - -KonnectorSuccess.propTypes = { - account: PropTypes.object.isRequired, - error: PropTypes.string, - title: PropTypes.string.isRequired, - messages: PropTypes.arrayOf(PropTypes.string), - onDone: PropTypes.func.isRequired, - successButtonLabel: PropTypes.string, - trigger: PropTypes.object.isRequired -} - -export { SuccessImage, SuccessLinks, BanksLink, DriveLink } - -export default translate()(KonnectorSuccess) diff --git a/src/components/ReactMarkdownWrapper.jsx b/src/components/ReactMarkdownWrapper.jsx deleted file mode 100644 index e7cb364f7f..0000000000 --- a/src/components/ReactMarkdownWrapper.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react' -import ReactMarkdown from 'react-markdown' - -export const reactMarkdownRendererOptions = { - // eslint-disable-next-line react/display-name - Link: props => ( - - {props.children} - - ) -} - -export const ReactMarkdownWrapper = ({ source }) => ( - -) - -export default ReactMarkdownWrapper diff --git a/src/components/services/CreateAccountService.jsx b/src/components/services/CreateAccountService.jsx deleted file mode 100644 index 2efb4d6017..0000000000 --- a/src/components/services/CreateAccountService.jsx +++ /dev/null @@ -1,68 +0,0 @@ -import React from 'react' -import { connect } from 'react-redux' - -import { translate } from 'cozy-ui/transpiled/react/providers/I18n' - -import AccountConnection from 'containers/AccountConnection' -import { - endConnectionCreation, - isConnectionRunning, - isCreatingConnection, - startConnectionCreation -} from 'ducks/connections' -import { - getCreatedConnectionAccount, - getTriggerByKonnectorAndAccount -} from 'reducers/index' - -class CreateAccountService extends React.Component { - constructor(props, context) { - super(props, context) - this.props.startCreation(this.props.konnector) - } - - onSuccess = account => { - this.props.endCreation() - this.props.onSuccess(account) - } - - render() { - const { t } = this.props - return ( - - - - ) - } -} - -const mapStateToProps = (state, ownProps) => { - // infos from route parameters - const { konnector } = ownProps - const createdAccount = getCreatedConnectionAccount(state) - const trigger = getTriggerByKonnectorAndAccount( - state, - konnector, - createdAccount - ) - return { - createdAccount, - isCreating: isCreatingConnection(state.connections), - isRunning: isConnectionRunning(state.connections, trigger), - trigger - } -} - -const mapDispatchToProps = (dispatch, ownProps) => ({ - startCreation: () => dispatch(startConnectionCreation(ownProps.konnector)), - endCreation: () => dispatch(endConnectionCreation()) -}) - -export default connect( - mapStateToProps, - mapDispatchToProps -)(translate()(CreateAccountService)) diff --git a/src/containers/AccountConnection.jsx b/src/containers/AccountConnection.jsx deleted file mode 100644 index ff30b0a912..0000000000 --- a/src/containers/AccountConnection.jsx +++ /dev/null @@ -1,165 +0,0 @@ -import PropTypes from 'prop-types' -import React, { Component } from 'react' -import { connect } from 'react-redux' - -import { translate } from 'cozy-ui/transpiled/react/providers/I18n' - -import KonnectorInstall from 'components/KonnectorInstall' -import KonnectorMaintenance from 'components/KonnectorMaintenance' -import UpdateMessage from 'components/Banners/UpdateMessage' -import styles from 'styles/accountConnection.styl' -import { isKonnectorUpdateNeededError } from 'lib/konnectors' -import { - enqueueConnection, - getConnectionError, - isConnectionConnected, - isConnectionEnqueued -} from 'ducks/connections' - -class AccountConnection extends Component { - constructor(props, context) { - super(props, context) - this.store = context.store - - this.state = { - isFetching: false, - maintenance: props.maintenance && props.maintenance[props.konnector.slug] - } - - this.handleLoginSuccess = this.handleLoginSuccess.bind(this) - this.handleError = this.handleError.bind(this) - this.handleDeleteSuccess = this.handleDeleteSuccess.bind(this) - } - - componentDidMount() { - if (this.props.error) this.handleError({ message: this.props.error }) - } - - componentDidUpdate(prevProps) { - const { success, queued } = this.props - const { connectionError } = this.state - - const succeed = !prevProps.success && success - const loginSucceed = !prevProps.queued && queued - - if (succeed || loginSucceed) { - // we reset the error in case of persisted errors - if (succeed && connectionError) this.setState({ connectionError: null }) - this.props.handleConnectionSuccess() - } - } - - handleLoginSuccess(trigger) { - const { enqueueConnection, handleConnectionSuccess } = this.props - handleConnectionSuccess() - enqueueConnection(trigger) - } - - handleDeleteSuccess() { - this.setState({ - submitting: false - }) - - this.props.handleDeleteSuccess() - } - - handleError(error) { - // eslint-disable-next-line no-console - console.error(error) - - this.setState({ - submitting: false, - connectionError: error.message - }) - } - - buildSuccessMessages(konnector) { - const { t } = this.props - const messages = [ - t('account.message.success.connect', { - name: konnector.name - }) - ] - - if ( - konnector.additionnalSuccessMessage && - konnector.additionnalSuccessMessage.message - ) { - messages.push(t(konnector.additionnalSuccessMessage.message)) - } - - return messages - } - - render() { - const { - createdAccount, - error, - handleConnectionSuccess, - konnector, - lang, - onCancel, - onDone, - queued, - success, - successButtonLabel, - t - } = this.props - const { connectionError, oAuthError, maintenance } = this.state - const successMessages = - success || queued ? this.buildSuccessMessages(konnector) : [] - const konnectorError = error || oAuthError || connectionError - return ( - - {!!konnector.available_version && ( - - )} - {maintenance ? ( - - ) : ( - - )} - - ) - } -} - -AccountConnection.contextTypes = { - store: PropTypes.object -} - -const mapStateToProps = (state, ownProps) => ({ - error: getConnectionError(state.connections, ownProps.trigger), - queued: isConnectionEnqueued(state.connections, ownProps.trigger), - success: isConnectionConnected(state.connections, ownProps.trigger) -}) - -const mapDispatchToProps = dispatch => { - return { - enqueueConnection: trigger => dispatch(enqueueConnection(trigger)) - } -} - -export default connect( - mapStateToProps, - mapDispatchToProps -)(translate()(AccountConnection)) diff --git a/src/lib/konnectors.js b/src/lib/konnectors.js index 77cd3e8ad8..e26754c79e 100644 --- a/src/lib/konnectors.js +++ b/src/lib/konnectors.js @@ -68,14 +68,6 @@ export function isKonnectorKnownError(error) { return error && error.type && Object.keys(ERROR_TYPES).includes(error.type) } -export function isKonnectorUpdateNeededError(error) { - return ( - error && - error.type && - Object.keys(UPDATE_NEEDED_ERRORS_TYPES).includes(error.type) - ) -} - export function buildKonnectorError(message) { var error = new Error(message) error.type = message.split('.')[0] diff --git a/src/styles/descriptionContent.styl b/src/styles/descriptionContent.styl deleted file mode 100644 index 39a722459f..0000000000 --- a/src/styles/descriptionContent.styl +++ /dev/null @@ -1,11 +0,0 @@ -.col-account-description-title, .col-account-description-title-centered - margin 1.1rem 0 .5rem - font-size 1.125rem - -.col-account-description-title-centered - text-align center - -.col-account-description-message - margin .5rem 0 - p - margin .5rem 0 diff --git a/test/components/Banners/UpdateMessage.spec.jsx b/test/components/Banners/UpdateMessage.spec.jsx deleted file mode 100644 index 57636951ab..0000000000 --- a/test/components/Banners/UpdateMessage.spec.jsx +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -import React from 'react' -import { render } from '@testing-library/react' - -import AppLike from 'test/AppLike' - -import UpdateMessage from 'components/Banners/UpdateMessage' - -describe('UpdateMessage component', () => { - it(`should be render correctly if not blocking update`, () => { - const root = render( - - - - ) - expect( - root.getByText('An update is available for this service.') - ).toBeTruthy() - expect( - root.getByText( - 'Perform this update to keep fetching your data and to have the latest features' - ) - ).toBeTruthy() - }) - - it(`should be render correctly if blocking update`, () => { - const root = render( - - - - ) - expect( - root.getByText('An update is available for this service.') - ).toBeTruthy() - expect(root.getByText('Update it to keep fetching your data')) - }) -}) diff --git a/test/components/DescriptionContent.spec.js b/test/components/DescriptionContent.spec.js deleted file mode 100644 index dfd8727faf..0000000000 --- a/test/components/DescriptionContent.spec.js +++ /dev/null @@ -1,45 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' - -import { tMock } from '../jestLib/I18n' -import { DescriptionContent } from 'components/DescriptionContent' - -describe('DescriptionContent component', () => { - beforeEach(() => { - jest.resetModules() - }) - - it('should be displayed correctly with just title and children', () => { - const { container } = render( - - Test description component children - - ) - expect(container).toMatchSnapshot() - }) - - it('should handle css from props via cssClassesObject', () => { - const cssClassesObject = { 'col-mock-class': true } - const { container } = render( - - ) - expect(container).toMatchSnapshot() - }) - - it('should be displayed correctly with two messages', () => { - const messages = [ - '**First** message `here`', - 'second message with [link](https://examplelink.mock)' - ] - const { container } = render( - - Test description component children - - ) - expect(container).toMatchSnapshot() - }) -}) diff --git a/test/components/ReactMarkdownWrapper.spec.jsx b/test/components/ReactMarkdownWrapper.spec.jsx deleted file mode 100644 index 5b37fd7b09..0000000000 --- a/test/components/ReactMarkdownWrapper.spec.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' - -import { - ReactMarkdownWrapper, - reactMarkdownRendererOptions -} from 'components/ReactMarkdownWrapper' - -describe('ReactMarkdownWrapper component', () => { - beforeEach(() => { - jest.resetModules() - }) - - it('should be displayed correctly if source provided', () => { - const { container } = render( - - ) - expect(container).toMatchSnapshot() - }) - - it('should be displayed correctly if source with link', () => { - const { container } = render( - - ) - expect(container).toMatchSnapshot() - }) -}) - -describe('ReactMarkdown options', () => { - it('should correctly return an anchor HTML element', () => { - expect( - reactMarkdownRendererOptions.Link({ - href: 'https://testlink.mock', - children: 'example link test for test' - }) - ).toMatchSnapshot() - }) -}) diff --git a/test/components/__snapshots__/DescriptionContent.spec.js.snap b/test/components/__snapshots__/DescriptionContent.spec.js.snap deleted file mode 100644 index e6278811b1..0000000000 --- a/test/components/__snapshots__/DescriptionContent.spec.js.snap +++ /dev/null @@ -1,70 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`DescriptionContent component should be displayed correctly with just title and children 1`] = ` - - - - A title mock - - Test description component children - - -`; - -exports[`DescriptionContent component should be displayed correctly with two messages 1`] = ` - - - - A title mock - - - - - First - - message - - here - - - - - - second message with - - link - - - - Test description component children - - -`; - -exports[`DescriptionContent component should handle css from props via cssClassesObject 1`] = ` - - - - A title mock - - - -`; diff --git a/test/components/__snapshots__/ReactMarkdownWrapper.spec.jsx.snap b/test/components/__snapshots__/ReactMarkdownWrapper.spec.jsx.snap deleted file mode 100644 index af1c30913c..0000000000 --- a/test/components/__snapshots__/ReactMarkdownWrapper.spec.jsx.snap +++ /dev/null @@ -1,41 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ReactMarkdown options should correctly return an anchor HTML element 1`] = ` - - example link test for test - -`; - -exports[`ReactMarkdownWrapper component should be displayed correctly if source provided 1`] = ` - - - - test - - using - - markdown - - - -`; - -exports[`ReactMarkdownWrapper component should be displayed correctly if source with link 1`] = ` - - - - test - - using - - markdown - - - -`; diff --git a/test/lib/konnectors.spec.js b/test/lib/konnectors.spec.js index 1a86dd6a22..00e8211758 100644 --- a/test/lib/konnectors.spec.js +++ b/test/lib/konnectors.spec.js @@ -79,16 +79,6 @@ describe('konnectors lib', () => { }) }) - describe('isKonnectorUpdateNeededError', () => { - it('returns true for TERMS_VERSION_MISMATCH', () => { - expect( - konnectors.isKonnectorUpdateNeededError( - konnectors.buildKonnectorError('TERMS_VERSION_MISMATCH') - ) - ).toBe(true) - }) - }) - describe('buildKonnectorError', () => { it('builds an error from a konnector to expected format', () => { const error = konnectors.buildKonnectorError('LOGIN_FAILED') diff --git a/yarn.lock b/yarn.lock index 62810d71d2..077b31f3e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13591,7 +13591,7 @@ react-lifecycles-compat@^3.0.4: resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-markdown@4.3.1, react-markdown@^4.0.8, react-markdown@^4.2.2: +react-markdown@^4.0.8, react-markdown@^4.2.2: version "4.3.1" resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-4.3.1.tgz#39f0633b94a027445b86c9811142d05381300f2f" integrity sha512-HQlWFTbDxTtNY6bjgp3C3uv1h2xcjCSi1zAEzfBW9OwJJvENSYiLXWNXN5hHLsoqai7RnZiiHzcnWdXk2Splzw==
- {t('maintenance.problem', { konnectorName })} -
- {children} -
- - First - - message - - here - -
- here -
- second message with - - link - -
- - test - - using - - markdown - -
- markdown -