diff --git a/packages/cozy-harvest-lib/src/components/AccountModal.jsx b/packages/cozy-harvest-lib/src/components/AccountModal.jsx index a442b833aa..f32a14ca01 100644 --- a/packages/cozy-harvest-lib/src/components/AccountModal.jsx +++ b/packages/cozy-harvest-lib/src/components/AccountModal.jsx @@ -118,7 +118,7 @@ export class AccountModal extends Component { return ( <> - {showAccountSelection && !konnector.clientSide ? ( + {showAccountSelection ? ( pushHistory('/new')} - showNewAccountButton={ - showNewAccountButton && !konnector.clientSide - } + showNewAccountButton={showNewAccountButton} /> )} diff --git a/packages/cozy-harvest-lib/src/components/AccountModal.spec.jsx b/packages/cozy-harvest-lib/src/components/AccountModal.spec.jsx index 467cbda81f..80de2daf90 100644 --- a/packages/cozy-harvest-lib/src/components/AccountModal.spec.jsx +++ b/packages/cozy-harvest-lib/src/components/AccountModal.spec.jsx @@ -83,36 +83,6 @@ describe('AccountModal', () => { expect(component.getElement()).toMatchSnapshot() }) - it('should not display the AccountSelect & Account creation button if the konnector is clientSide', async () => { - const clientSideComponent = shallow( - x} - accountId={accountIdMock} - accountsAndTriggers={accountsAndTriggersMock} - pushHistory={mockHistoryPush} - breakpoints={{ isMobile: true }} - onDismiss={jest.fn()} - /> - ) - await clientSideComponent.instance().componentDidMount() - - fetchAccount.mockResolvedValue({ - _id: 'account_2', - name: 'account_2' - }) - - expect(component.getElement()).toMatchSnapshot() - component.setProps({ - accountId: 'account_2' - }) - - await clientSideComponent - .instance() - .componentDidUpdate({ accountId: accountIdMock }) - expect(clientSideComponent.getElement()).toMatchSnapshot() - }) - it('should redirect to the correct locations', async () => { await component.instance().componentDidMount() diff --git a/packages/cozy-harvest-lib/src/components/Routes.jsx b/packages/cozy-harvest-lib/src/components/Routes.jsx index 40ae78ca0e..d90830ff11 100644 --- a/packages/cozy-harvest-lib/src/components/Routes.jsx +++ b/packages/cozy-harvest-lib/src/components/Routes.jsx @@ -85,6 +85,8 @@ const Routes = ({ konnectorRoot, konnector, onDismiss, datacardOptions }) => { accountId={match.params.accountId} accountsAndTriggers={accountsAndTriggers} onDismiss={onDismiss} + showNewAccountButton={!konnector.clientSide} + showAccountSelection={!konnector.clientSide} /> )} /> diff --git a/packages/cozy-harvest-lib/src/components/__snapshots__/AccountModal.spec.jsx.snap b/packages/cozy-harvest-lib/src/components/__snapshots__/AccountModal.spec.jsx.snap index 83861773c6..6d0ab6965d 100644 --- a/packages/cozy-harvest-lib/src/components/__snapshots__/AccountModal.spec.jsx.snap +++ b/packages/cozy-harvest-lib/src/components/__snapshots__/AccountModal.spec.jsx.snap @@ -177,105 +177,3 @@ exports[`AccountModal with an account should display the AccountSelect & Content `; - -exports[`AccountModal with an account should not display the AccountSelect & Account creation button if the konnector is clientSide 1`] = ` - - - - - - - - -`; - -exports[`AccountModal with an account should not display the AccountSelect & Account creation button if the konnector is clientSide 2`] = ` - - - - - - -`;