-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make run button functional #25
Merged
david-mears-2
merged 23 commits into
main
from
jidea-57-non-country-inputs-rebasing-onto-front-end-brach
Sep 13, 2024
+857
−158
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7d9c378
WIP 2: things related to post-form-submit, ie api and store
david-mears-2 02be36f
WIP. We dont have unit tests on the wip api endpoint + handler
david-mears-2 d1d4f9c
Remove store-related code
david-mears-2 7b146ba
test playwright ci
david-mears-2 52b12eb
Switch to using query params instead of body
david-mears-2 bcb53f2
Tests
david-mears-2 7434c9d
Refactor: Use pinia store for largeScreen refs
david-mears-2 782a8db
Update e2e test
david-mears-2 f45d8e9
remove comment
david-mears-2 12b7581
Try to improve playwright test
david-mears-2 8c0c4f5
Address PR comments
david-mears-2 0906bca
Use body instead of query for req's to run scenario
david-mears-2 0966d2b
Temporary change to allow web app to be compatible with latest r api
david-mears-2 143063c
Update e2e test to match latest R API build
david-mears-2 fbb2a05
Address PR comments
david-mears-2 2a03920
Use JSON data for request bodies instead of FormData
david-mears-2 67ba34d
fix integration tests
M-Kusumgar c3a4d8e
Merge pull request #30 from jameel-institute/jidea-57-non-country-inp…
david-mears-2 fbc712e
test changes
EmmaLRussell 93ca120
parse body in test
EmmaLRussell 501d92a
Merge pull request #33 from jameel-institute/jidea-57-mock-navigateTo-2
david-mears-2 d84c44c
Merge branch 'main' into jidea-57-non-country-inputs-rebasing-onto-fr…
david-mears-2 3e43583
Update e2e test to use real test run ids
david-mears-2 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
Loading status checks…
Update e2e test to match latest R API build
commit 143063c5b4399dfb8df22556febe1654f15e7d93
There are no files selected for viewing
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
Unchanged files with check annotations Beta
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
formSubmitting.value = true; | ||
const response = await $fetch<NewScenarioData>("/api/scenarios", { | ||
method: "POST", | ||
body: formDataObject, | ||
}).catch((error: FetchError) => { | ||
console.error(error); | ||
}); | ||
}; | ||
onMounted(() => { | ||
pageMounted.value = true; | ||
}); | ||
</script> | ||
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
} | ||
}; | ||
onMounted(() => { | ||
setScreenSize(); | ||
window.addEventListener("resize", setScreenSize); | ||
}); | ||
onBeforeUnmount(() => { |
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
import { runScenario } from "@/server/handlers/scenarios"; | ||
import { defineRApiEventHandler } from "@/server/utils/defineRApiEventHandler"; | ||
import { formDataToObject } from "@/server/utils/helpers"; | ||
import type { NewScenarioResponse } from "@/types/apiResponseTypes"; | ||
export default defineRApiEventHandler( | ||
async (event): Promise<NewScenarioResponse> => { | ||
const formDataBody = await readFormData(event); | ||
const newScenarioResponse = await runScenario(formDataToObject(formDataBody), event); | ||
return newScenarioResponse; | ||
}, | ||
); | ||
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
export interface AppState { | ||
largeScreen: boolean | ||
}; | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be resorting to hidden attribute tests in e2e tests of forms - we should just be able to look at the values of the inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can be confident that the values of the inputs are what we just selected. I think the test to do for the e2e would be to wait until the result page is implemented, and test that the displayed parameters are correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hang on, that doesn't look like the line (I thought) this was a comment for anymore, I'm pretty sure this was about the stringified JSON - or I thought it was!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks like it's commenting on the stringified JSON to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm just blind as a 🦇