-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: added Pagination for Wishlist #893
base: main
Are you sure you want to change the base?
feat: added Pagination for Wishlist #893
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodSpeed Performance ReportMerging #893 will not alter performanceComparing Summary
|
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.
hey, looks really good 🙌🏼
👉🏼 Could you please adjust the tests because they are failing
@kstala maybe you can help here? Would be nice to get this merged. |
@mkucmus, @kstala, and @khanSoliheen, I fixed the Test for the Now, we have 100% coverage for the Can be tested here: https://frontends-demo-h3h90r2m2-shopware-frontends.vercel.app/ |
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.
Thanks for the contribution!
Few suggestions for the API of composables + ts-ignore to be removed from tests :)
/** | ||
* Current page number | ||
*/ | ||
getCurrentPage: ComputedRef<number>; |
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.
it's computed property, not getter function, we should rename it
getCurrentPage: ComputedRef<number>; | |
currentPage: ComputedRef<number>; |
/** | ||
* total pages count | ||
*/ | ||
getTotalPagesCount: ComputedRef<number>; |
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.
same here
getTotalPagesCount: ComputedRef<number>; | |
totalPagesCount: ComputedRef<number>; |
@@ -27,10 +30,11 @@ export type UseSyncWishlistReturn = { | |||
/** | |||
* Wishlist items count | |||
*/ | |||
count: ComputedRef<number>; | |||
totalWishlistItemsCount: Ref<number>; |
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'm afraid that is an unnecessary breaking change; why do you feel the need to change it?
Also it should be a computed property
@@ -89,14 +96,13 @@ export function useSyncWishlist(): UseSyncWishlistReturn { | |||
} | |||
|
|||
const items = computed(() => _wishlistItems.value); | |||
const count = computed(() => items.value.length); |
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.
Count could just show totalWishlistItemsCount
value here
// @ts-ignore | ||
canSyncWishlist: { value: false }, |
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.
ts-ignore is not a solution, useUser doesn't have canSyncWishlist
so shouldn't be in the mock
// @ts-ignore | |
canSyncWishlist: { value: false }, |
}); | ||
vi.mocked(useSyncWishlist).mockReturnValue({ | ||
getWishlistProducts: () => undefined, | ||
// @ts-ignore |
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.
same - no ts-ignore, we need to make sure types are correct in composables
No description provided.