OBPIH-6969 Improve approach to product creation and stock data - #61
Merged
Merged
Conversation
alannadolny
force-pushed
the
OBPIH-6969
branch
from
September 8, 2025 10:46
0f30379 to
c59f6ee
Compare
alannadolny
force-pushed
the
OBPIH-6969
branch
from
September 8, 2025 11:29
c59f6ee to
dac4814
Compare
alannadolny
force-pushed
the
OBPIH-6969
branch
from
September 11, 2025 10:34
59ee5ba to
b75d61f
Compare
alannadolny
force-pushed
the
OBPIH-6969
branch
from
September 11, 2025 13:03
b75d61f to
368e7bc
Compare
awalkowiak
reviewed
Oct 15, 2025
awalkowiak
left a comment
Contributor
There was a problem hiding this comment.
I think it looks ok, maybe I would think next how to improve these lines:|
productService.setProduct('1');
const PRODUCT_ONE = await productService.getProduct();
productService.setProduct('2');
const PRODUCT_TWO = await productService.getProduct();
to just have a list or something, but for now we could go with what you have.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The main idea of this improvement is to simplify adding new products and inventories. Current solution doesn't require adding new data in env, app config, etc. To create a new product or inventory, it is needed to fulfill the CSV that can be found in
src/setup/dataImport. The data is loaded on every setup before running tests. If there will be a need to remove inventories or import other products while running specific tests, it is needed to create a new CSV file (for inventories with 0 qty, if removing) and call the endpoint that is called during setup. ID of every product that was created can be found in.data.json, so it's accessible by product code using helper methods that were created previously. Product data is also accessible from the AppConfig, but to get the specific that, there is a need to pass the product code. At this moment,productServiceis exactly the same service for every product. To change the product on which all of the operations will be executed, you should callsetProductand pass the product code.