-
Notifications
You must be signed in to change notification settings - Fork 3
Gemini tests #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Mjmcfarlane
wants to merge
8
commits into
main
Choose a base branch
from
geminiTests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Gemini tests #23
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4926aee
server access setup
Mjmcfarlane 7f6b646
server access setup
Mjmcfarlane 95710e9
Merge current version into local
Mjmcfarlane b888565
Created tests for the functions in gemini.js
Mjmcfarlane 5f7d0c1
Delete catalyst/src/.env
Mjmcfarlane 043f8c9
Update gemini.test.js
Mjmcfarlane 8d54658
Fixed questionnaire format tests
Mjmcfarlane 5565791
fixed the Booleans into variables and removed the test that used string
Mjmcfarlane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -49,4 +49,4 @@ | |
| "@babel/plugin-proposal-private-property-in-object": "^7.21.11", | ||
| "concurrently": "^8.2.2" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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,118 @@ | ||
| import validate_questionnaire_format from './gemini'; | ||
| import validate_task_format from './gemini'; | ||
| import createPlan from './gemini'; | ||
| import Questionnaire from './Questionnaire'; | ||
|
|
||
| //TESTS THE VALIDATE_QUESTIONAIRRE FORMAT FUNCTION | ||
| test('null input', () => { | ||
| const questionnaire = null; | ||
| var rightFormat = validate_questionnaire_format(questionnaire); | ||
| expect (rightFormat.toBe (false)); | ||
| }); | ||
|
|
||
| test('empty input', () => { | ||
| const questionnaire = ""; | ||
| var format = validate_questionnaire_format(questionnaire); | ||
| expect (rightFormat.toBe (false)); | ||
| }); | ||
|
|
||
| test('array size 5 input', () => { | ||
| const questionnaire = { 0:['1','2','3','4','5']}; | ||
| var rightFormat = validate_questionnaire_format(questionnaire); | ||
| expect(rightFormat.toBe(false)); | ||
| }); | ||
|
|
||
| test('array size one', () => { | ||
Mjmcfarlane marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const questionnaire = {0:['1']}; | ||
| var rightFormat = validate_questionnaire_format(str); | ||
| expect(rightFormat.toBe(false)); | ||
| }); | ||
|
|
||
| test('array size two', () => { | ||
| const str = {0:['1','2']}; | ||
| var rightFormat = validate_questionnaire_format(str); | ||
| expect(rightFormat.toBe(true)); | ||
| }); | ||
|
|
||
| test('array size one and two', () => { | ||
| const str = { | ||
| 0:['Q1','Q2'] | ||
| 1:['Q1'] | ||
| }; | ||
| var rightFormat = validate_questionnaire_format(str); | ||
| expect(rightFormat.toBe(true)); | ||
| }); | ||
|
|
||
| test('array size two and two', () => { | ||
| const str = { | ||
| 0:['Q1','Q2'] | ||
| 1:['Q1','Q2'] | ||
| }; | ||
| var rightFormat = validate_questionnaire_format(str); | ||
| expect(rightFormat.toBe(true)); | ||
| }); | ||
|
|
||
|
|
||
| //TESTS THE VALIDATE_TASK_FORMAT FUNCTION | ||
| test('both empty', () => { | ||
| var rightFormat = validate_task_format("",""); | ||
| expect(rightFormat.toBe(false)); | ||
| }); | ||
|
|
||
| test('both null', () => { | ||
| var rightFormat = validate_task_format(null,null); | ||
| expect(rightFormat.toBe(false)); | ||
| }); | ||
|
|
||
| test('null and non-object', () => { | ||
| var format = validate_task_format(null,42); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| test('null and object', () => { | ||
| var format = validate_task_format(null,Object); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| test('non-object and null', () => { | ||
| var format = validate_task_format("Hi",null); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| test('both non-objects', () => { | ||
| var format = validate_task_format(21,42); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| test('non-object and object', () => { | ||
| var format = validate_task_format(3,Object); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| test('object and null', () => { | ||
| var format = validate_task_format(Object,null); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| test('Object and non-object', () => { | ||
| var format = validate_task_format(Object,42); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| //lengths are not same | ||
| test('both objects', () => { | ||
| var format = validate_task_format([1,2,3],[4,5]); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| //lengths are same key 2 doesn't include key | ||
| test('both objects', () => { | ||
| var format = validate_task_format([1,2,3],[4,5,6]); | ||
| expect(format.toBe(false)); | ||
| }); | ||
|
|
||
| //lengths are same key 2 includes key | ||
| test('both objects', () => { | ||
| var format = validate_task_format([1,2,3],[1,2,3]); | ||
| expect(format.toBe(true)); | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.