Skip to content
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

testing pt2 #41

Open
atherdon opened this issue Jan 25, 2019 · 7 comments
Open

testing pt2 #41

atherdon opened this issue Jan 25, 2019 · 7 comments

Comments

@atherdon
Copy link
Member

we have different layout types.
and this layout types expect a different data structures inside of them. so if layout expect to have an id - we should pass it. if no - then we should alarm about it

@souzasmatheus
Copy link
Contributor

I am not so sure what this task is about. I am sorry.
I can see that each layout has a different type ('PDF1', 'PDF2', etc), but what do you mean it expects so have an id?

@atherdon
Copy link
Member Author

atherdon commented Feb 17, 2019

ok, i think i should give you some details here.
Right now, all these components and their wrappers looks not very logical. Before it was a huge project, where we keep everything.

At the first stage, we have only one(first) component, that works fine.
Then we decide to add 2 more layouts, in order to test and give more power to our users.
First 3 components/layouts related to displaying grocery lists data. I cannot show to you the exact showcase project, because we tear it apart and i think its broken at this moment.

Then I decided to test how we'll print a recipe, not a grocery list. So 4th component related to recipes data.

And when we move all print functionality away - i think it looks reasonable to upgrade the logic of our components and instead of few, make one with different layouts. And this task is part of my plan to slowly introduce you into the logic of how it works.


This part is actually related to answering your question:
the main problem will be, when we merge all components together, is that we don't cover well that there a different data structures.

Actually, I added a file: selector.js where we connecting to another our package, that return static data(our groceristar-fetch plugin is like a server replacer, so you can get data without connecting to a real server).
And at this file we have a methods, that return different type of data.
Not sure if you will be able to print that data yourself right now, but let simplify it.

Grocery list usually have this structure(here we have 2 grocery list objects):
xx

And inside of our RenderList component(s) we displaying that data.
But what if i'll push data with another structure? for example i'll delete few fields inside the object? it will cause us trouble. Because this component are not ready for changes in data-structure.
So we need to have test coverage, related to checking what type of data, we passing inside of it.
If you need some samples - I can share with you.

And if something is not clear - tell me - i have a lot of details to share

@atherdon
Copy link
Member Author

an actual example you can see here: https://github.com/GroceriStar/groceristar-fetch/blob/master/projects/GroceriStar/groceristar.test.js#L12
actually maybe we just need to use test from fetch plugin, just adapted to current needs of this component...

@atherdon
Copy link
Member Author

btw, did you accept invitation to our team at github? cannot add you to this repo...

@atherdon
Copy link
Member Author

@souzasmatheus
Copy link
Contributor

souzasmatheus commented Feb 27, 2019 via email

@atherdon
Copy link
Member Author

thank you for letting me know! ok - will wait for you - feel free and come back when you'l be ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants