-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support mocking and tests #143
Comments
If I understand the Redux store correctly, we can make the whole website display contents present in the store. Then, on startup, we fill the contents of the store dynamically based on an environment variable. However, we do need to be able to update the store every 30 min or so, or with webhooks (koala already supports webhooks, as used by Mongoose). Can the store be filled by dynamically by mocking data defined in a local database or something? How can we supply the mocking data? This can also immediately fix #131, where large assets are not loaded in time. |
The idea for the mocking that I have right now is that you start the application with a redux store with predefined values for the API slices, and you can test new features manually or iterate on them using that version of the system in development. The advantage is that all of the data is always available and predictable, and new developers don't need the contentful and koala keys to start developing, because they can use the mocked environment to develop their features in. Testing expands on the idea of mocking: the tests run in the mock environment and navigate the page and asserts things on it. To some extent these are more integration tests than unit tests, but vite has great tooling for those, and even coverage reports (though that might be a tad bit too extreme for the radio, i reckon). |
Yes, I meant that haha. Will the redux store in production be able to update its contents? For example, what if an activity is added or the number of enrollmentes have changed? We need to keep that logic. |
It is, the activities are reloaded in the radio/src/components/Activities.jsx Lines 7 to 9 in ddf8ec1
|
Having the redux store allows us to more easily mock all of the data, and therefore create tests more efficiently and reliably. I am still investigating what the most efficient way to do this is, so any input is greatly appreciated!
Originally posted by @stickyPiston in #140 (comment)
Let's hold the discussion here!
The text was updated successfully, but these errors were encountered: