Skip to content

Commit

Permalink
Fixed: App can only be accessed on localhost (#1697)
Browse files Browse the repository at this point in the history
* fixed remote host problem

* made doc changes

* fixed test

* increased coverage

* changed to doc based solution
  • Loading branch information
aarishshahmohsin authored Mar 11, 2024
1 parent 52fefa1 commit 093fda6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 109 deletions.
6 changes: 6 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ If you are a software developer working on your local system, then the URL would
REACT_APP_TALAWA_URL="http://localhost:4000/graphql/"
```

If you are trying to access Talawa Admin from a remote host with the API URL containing "localhost", You will have to change the API URL to

```
REACT_APP_TALAWA_URL="http://YOUR-REMOTE-ADDRESS:4000/graphql/"
```

For additional details, please refer the `How to Access the Talawa-API URL` section in the INSTALLATION.md file found in the [Talawa-API repo](https://github.com/PalisadoesFoundation/talawa-api).

## Setting up REACT_APP_RECAPTCHA_SITE_KEY in .env file
Expand Down
103 changes: 31 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -308,43 +308,6 @@ describe('Testing Advertisement Entry Component', () => {
});
});

test('Updates the advertisement and shows error toast on successful update', async () => {
const updateAdByIdMock = jest.fn();

mockUseMutation.mockReturnValue([updateAdByIdMock]);

render(
<ApolloProvider client={client}>
<Provider store={store}>
<BrowserRouter>
<I18nextProvider i18n={i18nForTest}>
<AdvertisementRegister
formStatus="edit"
idEdit="-100"
nameEdit="Updated"
endDateEdit={new Date()}
startDateEdit={new Date()}
typeEdit="POPUP"
orgIdEdit="1"
advertisementMediaEdit=""
/>
</I18nextProvider>
</BrowserRouter>
</Provider>
</ApolloProvider>,
);

fireEvent.click(screen.getByTestId('editBtn'));

fireEvent.click(screen.getByTestId('addonupdate'));

expect(updateAdByIdMock).toHaveBeenCalledWith({
variables: {
id: '-100',
},
});
});

test('Simulating if the mutation does not have data variable while registering', async () => {
Object.defineProperty(window, 'location', {
configurable: true,
Expand Down

0 comments on commit 093fda6

Please sign in to comment.