Skip to content

Commit

Permalink
Bug/us174 replace select dropdown (#166)
Browse files Browse the repository at this point in the history
* bug: 🚑 Debug error boundary component, remove buggy component

* feat: ✨ Implement highlighting the active navbar item

* chore: 🚧 Improve naming

* chore: 🚧 Fix SRP-principle for WTR-screens

* chore: 🚧 Improve route naming

* chore: 🚧 Fix tests

* chore: 🚧 Fix route usage

* chore: 🚧 Fix E2E tests

* chore: 🚧 Simplify language select component

* feat: ✨ Refactor dropdown component

* chore: 🚧 Remove unused packages

* chore: 🚧 Do not crash on uncaught exceptions

* bug: 🚑 Patch problem in react native element dropdown package

* chore: 🚧 Update README.md

* chore: 🚧 Run prettier

* chore: 🚧 Update translations

* chore: 🚧 Theme dropdown component for mobile phone

* chore: 🚧 Fix flaky tests
  • Loading branch information
KoenvanMeijeren authored Dec 12, 2023
1 parent 8b2f338 commit ed8e7a8
Show file tree
Hide file tree
Showing 19 changed files with 410 additions and 922 deletions.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,38 @@ cp .env.example .env

#### Required values

The table below shows the required values for the .env file.

| Name | Description | Link |
| ---------------- | --------------------------------- | ------------------------------------ |
| `OPENAI_API_KEY` | The key to access the OpenAI API. | https://platform.openai.com/api-keys |
The table below shows the values for the .env file.

| Name | Description | Link |
| ---------------- | --------------------------------------------------------------------------------------- | ------------------------------------ |
| `OPENAI_API_KEY` | The key to access the OpenAI API. | https://platform.openai.com/api-keys |
| `APP_DEBUG` | Shows errors when enabled. | - |
| `AI_ENABLED` | Turns on the AI API. Recommended to turn this off in development, because of the costs. | - |
| `WP_CONTENT_URL` | The site to be used for fetching the WTR content (e.g. tech providers & themes). | - |
| `WP_DATA_URL` | The site to be used for fetching the custom data (e.g. prompt library & courses). | - |
| `WP_USERNAME` | The username to gain access to the WordPress Data API. | - |
| `WP_PASSWORD` | The password to gain access to the WordPress Data API. | - |

### Install dependencies

```shell
npm install
npm run postinstall
```

## Scripts

The package.json file contains several scripts for development and testing:

`npm run start`: Starts the expo server.
`npm run android`: Starts the expo server and opens the app in an Android emulator.
`npm run ios`: Starts the expo server and opens the app in an iOS simulator.
`npm run web`: Starts the expo server and opens the app in a web browser.
`npm run tests`: Runs all tests.
`npm run lint:run`: Runs the eslint check.
`npm run prettier:run`: Runs the prettier check.
`npm run tsc:run`: Runs the typescript check.

## Deployment

The deployment of the app is managed via: https://expo.dev/accounts/windesheim.ai/projects/winsight.
Expand Down
26 changes: 0 additions & 26 deletions __tests__/components/input/WhSelectDropdown.test.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions __tests__/unit/constants/Languages.test.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import {
languageOptions,
LanguageCode,
getLanguageCodeByTranslation,
languageLabels,
} from '../../../src/lib/translations/languageOptions';

describe('Languages', () => {
it('should return language labels', () => {
const labels = languageLabels();
// @ts-ignore
expect(labels).toEqual(Object.values(languageOptions));
});

it('should get language code by translations', () => {
const translation = 'Nederlands';
const languageCode = getLanguageCodeByTranslation(translation);
Expand Down
4 changes: 4 additions & 0 deletions cypress/e2e/home.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ describe('Home page tests', () => {
});

it('can display the home page', () => {
cy.intercept('GET', '/wp-json/winpl/v1/prompts/', {
fixture: 'prompts/data.json',
}).as('getData');

cy.visit('/');

cy.contains('Home');
Expand Down
6 changes: 6 additions & 0 deletions cypress/e2e/wtr.cy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Disable uncaught exception handling.
Cypress.on('uncaught:exception', () => {
// Returning false here prevents Cypress from failing the test.
return false;
});

describe('WTR page tests', () => {
beforeEach(() => {
cy.visit('/');
Expand Down
Loading

0 comments on commit ed8e7a8

Please sign in to comment.