|
| 1 | +import { render } from '@testing-library/react'; |
| 2 | + |
| 3 | +import { MIME_TYPES } from '@proton/shared/lib/constants'; |
| 4 | +import { |
| 5 | + ENCRYPTION_PREFERENCES_ERROR_TYPES, |
| 6 | + EncryptionPreferencesError, |
| 7 | +} from '@proton/shared/lib/mail/encryptionPreferences'; |
| 8 | +import { PACKAGE_TYPE } from '@proton/shared/lib/mail/mailSettings'; |
| 9 | +import { veventBuilder } from '@proton/testing/index'; |
| 10 | +import noop from '@proton/utils/noop'; |
| 11 | + |
| 12 | +import { INVITE_ACTION_TYPES } from '../../../interfaces/Invite'; |
| 13 | +import SendWithErrorsConfirmationModal from './SendWithErrorsConfirmationModal'; |
| 14 | + |
| 15 | +const sendPreferencesMap = { |
| 16 | + error: new EncryptionPreferencesError(ENCRYPTION_PREFERENCES_ERROR_TYPES.EMAIL_ADDRESS_ERROR, 'error'), |
| 17 | + isInternal: false, |
| 18 | + encrypt: false, |
| 19 | + sign: false, |
| 20 | + pgpScheme: PACKAGE_TYPE.SEND_CLEAR, |
| 21 | + mimeType: MIME_TYPES.PLAINTEXT, |
| 22 | + publicKeys: [], |
| 23 | + hasApiKeys: false, |
| 24 | + hasPinnedKeys: false, |
| 25 | + encryptionDisabled: false, |
| 26 | +}; |
| 27 | + |
| 28 | +describe('SendWithErrorsConfirmationModal', () => { |
| 29 | + it('works with only one CTA', () => { |
| 30 | + const vevent = veventBuilder({}); |
| 31 | + render( |
| 32 | + <SendWithErrorsConfirmationModal |
| 33 | + sendPreferencesMap={{ |
| 34 | + '[email protected]': sendPreferencesMap, |
| 35 | + }} |
| 36 | + inviteActions={{ selfAddress: undefined, type: INVITE_ACTION_TYPES.DECLINE_INVITATION }} |
| 37 | + vevent={vevent} |
| 38 | + cancelVevent={vevent} |
| 39 | + onClose={noop} |
| 40 | + onConfirm={noop} |
| 41 | + isOpen={true} |
| 42 | + /> |
| 43 | + ); |
| 44 | + }); |
| 45 | +}); |
0 commit comments