Skip to content

Commit

Permalink
version 0.5.1
Browse files Browse the repository at this point in the history
- Fixed notification behavior: tapping on a notification should open the app
- Improved stability of the app: new tests implemented
- Update checker fix: now the app only shows the update icon when a new version is available
- Some accessibility improvements
  • Loading branch information
besdar committed Nov 5, 2024
1 parent 316d1e7 commit 71b0933
Show file tree
Hide file tree
Showing 34 changed files with 1,365 additions and 33 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

Wordum is a powerful language learning application designed to help users expand their vocabulary through interactive flashcards. Built with [React Native](https://reactnative.dev), Wordum offers a seamless experience for learners of all levels.

| ![demo](./assets/demo.gif) | ![Create collection screen](./assets/Screenshot2.png) | ![Exercises screen](./assets/Screenshot4.png) | ![Collections screen](./assets/Screenshot3.png) |
|---|---|---|---|

### Current Status

Wordum is currently in public beta. Any contributions to expand the app to other platforms (only Android phones are currently supported) or to help fix translations (all app's locales except `en` and `ru` are autogenerated) are highly welcomed.

## Demos

| ![demo](./assets/demo.gif) | ![Create collection screen](./assets/Screenshot2.png) | ![Exercises screen](./assets/Screenshot4.png) | ![Collections screen](./assets/Screenshot3.png) |
|---|---|---|---|

## Main features

- **Flashcard Collections**: Create and manage collections of flashcards tailored to your learning needs.
Expand All @@ -27,7 +25,6 @@ Wordum is currently in public beta. Any contributions to expand the app to other
- Values in selects are not translated
- app's icon is too generic
- translation script is incompatible with text formattings/links
- no accessibility support
- [you name it](https://github.com/besdar/wordum/issues)

## Features wishlist
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "0.5.0"
versionName "0.5.1"
}
signingConfigs {
debug {
Expand Down
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = {
'./src/shared/config/mocks/react-native-modules.ts',
'./src/shared/config/mocks/ui.tsx',
'./src/shared/config/mocks/navigator.ts',
'./src/shared/config/mocks/eventBus.ts',
'./src/shared/config/mocks/sound.ts',
],
setupFilesAfterEnv: ['./src/shared/config/mocks/jest-setup.ts'],
fakeTimers: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wordum",
"version": "0.5.0",
"version": "0.5.1",
"private": true,
"homepage": "https://github.com/besdar/wordum",
"author": "Beskov Dmitry @besdar",
Expand Down
24 changes: 24 additions & 0 deletions src/app/model/__tests__/useNotifications.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {renderHook} from '@testing-library/react-native';
import {useNotifications} from '../useNotifications';
import {
initLearningReminder,
resetLearningReminder,
} from '../../../shared/lib/notifications';
import {EVENT_TYPE, eventBus} from '../../../shared/model/EventBus';

jest.mock('../../../shared/lib/notifications', () => ({
initLearningReminder: jest.fn(),
resetLearningReminder: jest.fn(),
}));

describe('useNotifications', () => {
it('initialized reminder and reset it on event', () => {
renderHook(() => useNotifications());

expect(initLearningReminder).toHaveBeenCalledTimes(1);

eventBus.emit(EVENT_TYPE.TRAINING_FINISHED);

expect(resetLearningReminder).toHaveBeenCalledTimes(1);
});
});
29 changes: 29 additions & 0 deletions src/pages/about/__tests__/About.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {render, screen, userEvent} from '@testing-library/react-native';
import {About} from '../About';
import React from 'react';
import {Linking} from 'react-native';

jest.mock('../../../../package.json', () => ({
version: '1.0',
}));

describe('About', () => {
it('should match the snapshot', () => {
const {toJSON} = render(<About />);

expect(toJSON()).toMatchSnapshot();
});

it('should not call onPress when button clicked', async () => {
const spy = jest.spyOn(Linking, 'openURL').mockImplementation();

render(<About />);

const button = screen.getByRole('button');

const user = userEvent.setup();
await user.press(button);

expect(spy).toHaveBeenCalled();
});
});
199 changes: 199 additions & 0 deletions src/pages/about/__tests__/__snapshots__/About.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`About should match the snapshot 1`] = `
<RCTScrollView>
<View>
<Text
style={
[
{
"textAlign": "left",
},
{
"color": "rgba(28, 27, 31, 1)",
"fontFamily": "System",
"fontWeight": "400",
"letterSpacing": 0,
},
{
"writingDirection": "ltr",
},
undefined,
]
}
>
about_text
</Text>
<View
collapsable={false}
style={
{
"backgroundColor": "transparent",
"borderRadius": 20,
"shadowColor": "#000",
"shadowOffset": {
"height": 0,
"width": 0,
},
"shadowOpacity": 0,
"shadowRadius": 0,
}
}
testID="button-container-outer-layer"
>
<View
collapsable={false}
style={
{
"backgroundColor": "transparent",
"borderColor": "transparent",
"borderRadius": 20,
"borderStyle": "solid",
"borderWidth": 0,
"flex": undefined,
"minWidth": 64,
"shadowColor": "#000",
"shadowOffset": {
"height": 0,
"width": 0,
},
"shadowOpacity": 0,
"shadowRadius": 0,
}
}
testID="button-container"
>
<View
accessibilityRole="button"
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
focusable={true}
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
[
{
"overflow": "hidden",
},
{
"borderRadius": 20,
},
]
}
testID="button"
>
<View
style={
[
{
"alignItems": "center",
"flexDirection": "row",
"justifyContent": "center",
},
undefined,
]
}
>
<Text
numberOfLines={1}
selectable={false}
style={
[
{
"textAlign": "left",
},
{
"color": "rgba(28, 27, 31, 1)",
"writingDirection": "ltr",
},
[
{
"fontFamily": "System",
"fontSize": 14,
"fontWeight": "500",
"letterSpacing": 0.1,
"lineHeight": 20,
},
[
{
"marginHorizontal": 16,
"marginVertical": 9,
"textAlign": "center",
},
false,
{
"marginHorizontal": 12,
},
undefined,
false,
{
"color": "rgba(103, 80, 164, 1)",
"fontFamily": "System",
"fontSize": 14,
"fontWeight": "500",
"letterSpacing": 0.1,
"lineHeight": 20,
},
undefined,
],
],
]
}
testID="button-text"
>
open_project_page
</Text>
</View>
</View>
</View>
</View>
<Text
style={
[
{
"textAlign": "left",
},
{
"color": "rgba(28, 27, 31, 1)",
"fontFamily": "System",
"fontWeight": "400",
"letterSpacing": 0,
},
{
"writingDirection": "ltr",
},
undefined,
]
}
>
app_version
:
1.0 (beta)
</Text>
</View>
</RCTScrollView>
`;
17 changes: 8 additions & 9 deletions src/pages/collection-learning/CollectionLearning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export const CollectionLearning = ({
sound,
} = useTrainingWord(collection);

const setNextWord = (answer: Answers) => {
setNextTrainingWord(answer);
setAnswerShowing(false);
};

if (isItFinal) {
return (
<Grid
Expand All @@ -67,11 +72,6 @@ export const CollectionLearning = ({
);
}

const setNextWord = (answer: Answers) => {
setNextTrainingWord(answer);
setAnswerShowing(false);
};

if (learningType === LearningType.Flascards) {
return (
<FlashcardWrapper
Expand Down Expand Up @@ -160,11 +160,10 @@ export const CollectionLearning = ({
);
}

if (!trainingWord) {
if (!trainingWord && !isItFinal) {
return <CenteredActivityIndicator />;
}

if (!trainingWord) {
} else if (!trainingWord) {
// not reachable
return (
<Grid
direction="column"
Expand Down
Loading

0 comments on commit 71b0933

Please sign in to comment.