-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from BU-Spark/Chris-Testing-and-Final-Clean-up
Adding tests and documentation.
- Loading branch information
Showing
23 changed files
with
643 additions
and
203 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Run Jest Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
- sp24-dev | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run tests | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -381,7 +381,13 @@ File Structure: | |
- Typeform is also limited to one video per page, which is another reason a custom backend is needed | ||
|
||
### Utils | ||
|
||
* apiUtils.tsx | ||
* getYouTubeEmbedUrl | ||
- Returns the YouTube embed URL for a given YouTube video either in short form or long form. | ||
* extractBetweenResources | ||
- Returns the text value between [*resources*] tags that are passed in the description, typically pasted from /resource-link-gen | ||
* removeResourcesSection | ||
- Returns the text value without [*resources*] tags and the content inside the tags that are passed in the description, typically pasted from /resource-link-gen | ||
* BodyContentStyle.tsx | ||
* Common style traits | ||
- Establishes consistent color schemes and border styles | ||
|
@@ -425,24 +431,15 @@ File Structure: | |
|
||
### Tests | ||
|
||
Docs Written by @ArkashJ, contact for assistance | ||
Docs Written by @jacob-stein1, contact for assistance | ||
DOCUMENTATION | ||
|
||
---> Nextjs-Tests | ||
-> index.tests.tsx | ||
-> QuestionnareBodyContent.tests.tsx | ||
-> Questionnare.tests.tsx | ||
-> SolutionPages.tests.tsx | ||
|
||
All these tests check whether the components have been rendered or not | ||
|
||
cd to the Nextjs-Tests file, install the jest dependency and run tests. Detailed explantion in the TestDocs.md file | ||
We have written test cases to check the rendering of components, the function of contexts, and more. Testing is written using the Jest JavaScript testing framework. See their [documentation](https://jestjs.io/docs/getting-started) for more info. | ||
|
||
<img width="285" alt="Screenshot 2023-05-02 at 5 41 41 PM" src="https://user-images.githubusercontent.com/86805856/235793030-dfd1807f-3157-4a73-a605-c2cae6f6e88e.png"> | ||
Tests are contained within a '**tests**' directory within each sub-directory of the project. For example /pages/**tests**/'page'.test.js contains the test cases for each page in the pages directory. | ||
|
||
Move the tests to "** test **" folder in pages folder. Then run 'npm run test'. Make sure you have jest installed. For more instructions, navigate to docs in tests folder. | ||
To run all tests: | ||
|
||
Commands to Run: | ||
$ npm run test | ||
|
||
### Recommended Next Steps | ||
|
@@ -466,5 +463,6 @@ $ npm run test | |
### Deployment | ||
|
||
We deployed the frontend in [vercel](https://se-bch-als-resource-app-zeta.vercel.app/) | ||
Please note the deployed link does not work on the BU Network for some reason. | ||
|
||
You can contact Jacob at [email protected] for information if you need. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
} | ||
|
||
module.exports = nextConfig | ||
module.exports = { | ||
reactStrictMode: true | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//export const API_URL = "http://localhost:1338" | ||
export const API_URL = "https://se-bch-als-resource-app-production.up.railway.app" | ||
//export const API_URL = "https://se-bch-als-resource-app-production.up.railway.app" | ||
export const TYPEFORM_API_URL = "https://api.typeform.com" | ||
export const COMMUNICATION_FORM_ID = "EJxD8FoP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.