diff --git a/assets/adaptive-icon.png b/assets/adaptive-icon.png index f687292f..ccff882d 100644 Binary files a/assets/adaptive-icon.png and b/assets/adaptive-icon.png differ diff --git a/assets/appName.png b/assets/appName.png deleted file mode 100644 index 54ab6265..00000000 Binary files a/assets/appName.png and /dev/null differ diff --git a/assets/appName_dark.png b/assets/appName_dark.png deleted file mode 100644 index d44dc482..00000000 Binary files a/assets/appName_dark.png and /dev/null differ diff --git a/assets/icon.png b/assets/icon.png deleted file mode 100644 index 8274aaaa..00000000 Binary files a/assets/icon.png and /dev/null differ diff --git a/assets/icon_transparent_dark.png b/assets/icon_transparent_dark.png deleted file mode 100644 index c75f7f8d..00000000 Binary files a/assets/icon_transparent_dark.png and /dev/null differ diff --git a/assets/logo_transparent.png b/assets/logo_transparent.png deleted file mode 100644 index 6e74826f..00000000 Binary files a/assets/logo_transparent.png and /dev/null differ diff --git a/assets/adaptive-icon-.png b/assets/qr-icon.png similarity index 100% rename from assets/adaptive-icon-.png rename to assets/qr-icon.png diff --git a/config/app.config.ts b/config/app.config.ts index de76eb40..db23e5e3 100644 --- a/config/app.config.ts +++ b/config/app.config.ts @@ -47,7 +47,7 @@ const config: ExpoConfig = { version: `${version}${!IS_PROD ? `-${_appVariant}` : ''}`, scheme: 'cashu', orientation: 'portrait', - icon: './assets/icon.png', + icon: './assets/icon_transparent.png', userInterfaceStyle: 'light', splash: { image: './assets/splash.png', diff --git a/package-lock.json b/package-lock.json index 03856638..0396723e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "enuts", - "version": "0.0.3-alpha", + "version": "0.0.5-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "enuts", - "version": "0.0.3-alpha", + "version": "0.0.5-alpha", "license": "AGPL-3.0-only", "dependencies": { "@bugsnag/expo": "^48.1.0", diff --git a/package.json b/package.json index 1c0c393e..ae6c1190 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "blind-signatures", "lightning-network" ], - "version": "0.0.4-alpha", + "version": "0.0.5-alpha", "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/cashubtc/eNuts/issues" diff --git a/src/components/QR.tsx b/src/components/QR.tsx index 332bde8d..e015f5c2 100644 --- a/src/components/QR.tsx +++ b/src/components/QR.tsx @@ -17,7 +17,7 @@ export default function QR({ size, value, onError }: QRProps) { size={size} value={value} // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - logo={require('../../assets/adaptive-icon.png')} + logo={require('../../assets/qr-icon.png')} logoBorderRadius={10} logoBackgroundColor='#fafafa' logoMargin={3} diff --git a/src/components/modal/index.tsx b/src/components/modal/index.tsx index 640c4b56..f49c071b 100644 --- a/src/components/modal/index.tsx +++ b/src/components/modal/index.tsx @@ -9,7 +9,7 @@ interface IMyModalProps { animation?: 'slide' | 'fade' | 'none' visible: boolean success?: boolean - isContactList?: boolean + hasNoPadding?: boolean close?: () => void children: React.ReactNode } @@ -19,7 +19,7 @@ export default function MyModal({ animation, visible, success, - isContactList, + hasNoPadding, close, children }: IMyModalProps) { @@ -43,7 +43,7 @@ export default function MyModal({ ...styles(color, highlight).common, ...styles(color, highlight).invoiceAmountModalView, } - if (isContactList) { + if (hasNoPadding) { styling = { ...styling, ...styles(color, highlight).contactList } } return styling @@ -58,6 +58,7 @@ export default function MyModal({ transparent animationType={animation} onRequestClose={close} + testID='testCoinSelectionModal' > + + diff --git a/test/components/AddressBook.test.tsx b/test/components/AddressBook.test.tsx index e1d84ebd..50bd4c73 100644 --- a/test/components/AddressBook.test.tsx +++ b/test/components/AddressBook.test.tsx @@ -1,6 +1,9 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import AddressBook from '@comps/screens/Addressbook/Book' +import AddressbookModal from '@comps/screens/Addressbook/modal' +import { l } from '@src/logger' import { act, fireEvent, render, screen } from '@testing-library/react-native' jest.useFakeTimers() @@ -40,6 +43,16 @@ describe('Test the Addressbook page', () => { fireEvent.press(screen.getByTestId('addPersonal')) expect(screen.queryByPlaceholderText('Name')).toBeNull() }) + it('Addressbook modal has a specific style applied', () => { + render( + l('test')} + setInput={() => l('test')} + /> + ) + const modal = screen.getByTestId('testCoinSelectionModal') + expect(modal.props.children.props.children.props.style[0].paddingHorizontal).toBe(0) + }) // TODO test the functionality of adding a new contact and rendering it // eslint-disable-next-line jest/no-commented-out-tests // it('Render the new contact', async () => { diff --git a/test/components/CoinSelectionModal.test.tsx b/test/components/CoinSelectionModal.test.tsx new file mode 100644 index 00000000..74dc0a5a --- /dev/null +++ b/test/components/CoinSelectionModal.test.tsx @@ -0,0 +1,78 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import { CoinSelectionModal } from '@screens/Lightning/modal' +import { l } from '@src/logger' +import { render, screen } from '@testing-library/react-native' + +describe('Basic styling test of the CoinSelectionModal component', () => { + it('has a specific style applied', () => { + render( + l('test coin selection modal')} + proofs={[]} + setProof={() => l('proofs')} + /> + ) + const modal = screen.getByTestId('testCoinSelectionModal') + expect(modal.props.children.props.children.props.style[0].paddingHorizontal).toBe(0) + }) + it('hides the confirm button if not enough proofs are selected', () => { + render( + l('test coin selection modal')} + proofs={[ + { selected: false, amount: 4, secret: '', C: '', id: '0' }, + { selected: false, amount: 8, secret: '', C: '', id: '1' }, + ]} + setProof={() => l('proofs')} + /> + ) + expect(screen.queryByText('Confirm')).toBeNull() + }) + it('should display the confirm button if enough proofs are selected', () => { + render( + l('test coin selection modal')} + proofs={[ + { selected: true, amount: 4, secret: '', C: '', id: '0' }, + { selected: true, amount: 8, secret: '', C: '', id: '1' }, + ]} + setProof={() => l('proofs')} + /> + ) + expect(screen.getByText('Confirm')).toBeDefined() + }) + it('should display the change after selecting more proofs than needed', () => { + render( + l('test coin selection modal')} + proofs={[ + { selected: true, amount: 4, secret: '', C: '', id: '0' }, + { selected: true, amount: 8, secret: '', C: '', id: '1' }, + ]} + setProof={() => l('proofs')} + /> + ) + expect(screen.getByText('Change')).toBeDefined() + expect(screen.getByText('2 Sat')).toBeDefined() + }) + it('should not display the change after selecting the exact proofs needed', () => { + render( + l('test coin selection modal')} + proofs={[ + { selected: true, amount: 4, secret: '', C: '', id: '0' }, + { selected: true, amount: 4, secret: '', C: '', id: '1' }, + { selected: true, amount: 2, secret: '', C: '', id: '2' }, + ]} + setProof={() => l('proofs')} + /> + ) + expect(screen.queryByText('Change')).toBeNull() + }) +})