Closed tomasciccola closed 1 week ago
Looks like tests are failing. Could you fix those?
So, the issue with the failing test is the following:
That test loads the config twice in parallel (using Promise.all
) and results in presets
, fields
and translations
being loaded to the database twice. Those doctypes should be deleted before loading a new config, but this doesn't happen when loading in parallel.
So to fix this tests I'm thinking:
Promise.all([project.importConfig, project.importConfig])
internally it would force sequetial execution). I don't know if we can actually enforce this. A weird way I'm thinking that can solve this would be having a boolean in the class (like this.#loadingConfig
). Not ideal, but it solves this caseLGTM once we move to
this.$translation.dataType
(happy to discuss alternatives) and fix the failing test.
I've changed the failing tests so that it now expects an error being throwed. Despite that, the test still fails... any pointers??
should close #482
Additionally this adds code to
MapeoProject
. Specifically:translation
as a getter (only used in tests, but may be useful in the future)There's a test case where I try to load the default config twice in parallel that results in - what I think - unwanted expectations. Basically we get double the presets, fields and translations since when each config is loaded there's no docs to delete. We should think if this is a valid (possible) case and how we can fix the code to avoid this?