Create mocks for the entire Customer Account extension API#3905
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8c15ddb to
4a0e80d
Compare
3e06b36 to
072992f
Compare
4a0e80d to
27fe3a8
Compare
072992f to
34763c2
Compare
27fe3a8 to
8fccf50
Compare
34763c2 to
c11b76b
Compare
8fccf50 to
b6b83e9
Compare
c11b76b to
bb5b1ed
Compare
bab7729 to
a303042
Compare
344b671 to
af00386
Compare
a303042 to
2db9df6
Compare
af00386 to
7049f9e
Compare
6e15cd7 to
83b81e0
Compare
7049f9e to
1a6144c
Compare
83b81e0 to
69f7238
Compare
1a6144c to
62487cd
Compare
69f7238 to
bb90420
Compare
62487cd to
4fd668d
Compare
bb90420 to
9707ec1
Compare
4fd668d to
d8892b1
Compare
9707ec1 to
2b029e3
Compare
cc4dd82 to
d058148
Compare
e04bdfe to
4c9b881
Compare
d058148 to
e592271
Compare
4c9b881 to
1ab00cd
Compare
e592271 to
776e604
Compare
1ab00cd to
724d295
Compare
776e604 to
d619193
Compare
724d295 to
2364cea
Compare
d619193 to
ec9fbb4
Compare
2364cea to
6ec4c50
Compare
|
|
||
| const customerAccountMockFactories: CustomerAccountMockFactory = { | ||
| // StandardApi only | ||
| 'customer-account.page.render': createStandardApiProperties, |
There was a problem hiding this comment.
Should we also add the navigation api? https://shopify.dev/docs/api/customer-account-ui-extensions/latest/apis/navigation
navigate is available in all targets, full page extensions have more properties available
There was a problem hiding this comment.
oh yeah. Is this available for Admin, too? I can't tell.
There was a problem hiding this comment.
I added a mock for all surfaces (on the base branch). Good call, thanks!
There was a problem hiding this comment.
Why all surfaces? 😅 Checkout doesn't have it, right?
There was a problem hiding this comment.
if at least two surfaces include it then I think it's good to include it everywhere. We could make navigate() throw an error if the extension under test is in an unsupported target.
6ec4c50 to
32fb2a4
Compare
44a456a to
f7c9ffa
Compare
32fb2a4 to
a026d49
Compare
|
Tried to run tests, but it failed to resolve the package. |
|
Hmm, this is working for me. Is this what you did? |
ah nope, didn't run the |
|
Not sure if expected, after running yarn, I have diff in the yarn.lock diff --git a/yarn.lock b/yarn.lock
index ecd4402ac..9094c8db4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2024,6 +2024,13 @@
resolved "https://registry.npmjs.org/@shopify/typescript-configs/-/typescript-configs-5.1.0.tgz"
integrity sha512-RywGBTR+nQyJLxcrUcihPkHPIG3pIQI6i0YwMrM5rs9nWJ0+9A5HKEcboyGPLH+8V08EXGfFQ6H820O9ajyk4A==
+"@shopify/ui-extensions@*":
+ version "2026.1.2"
+ resolved "https://npm.shopify.io/node/@shopify/ui-extensions/-/ui-extensions-2026.1.2.tgz#2599a6bf6063640f467a3c3ff2ab80afbd2de9d0"
+ integrity sha512-lngck7uPBcpMrL36cw/7NJCBsagIleB6dw/hrxEtW600PdPoOUoUyhOnsjM4J5NCheNGD4Ar2h/a0zh2ki9QXw==
+ dependencies:
+ ts-morph "^25.0.1"
+
"@sinclair/typebox@^0.24.1":
version "0.24.51"
resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz" |
f7c9ffa to
b8004e1
Compare
a026d49 to
68598b8
Compare
|
@kumar303 why did you choose to have all those examples be packages that use npm and handle their own locks etc? Why not make them part of the workspaces for easier dependency management? |
|
I updated all the example readmes to specify the build step. As for |
probably no good reason. I didn't think I could make nested example directories part of the workspace. |
|
and yarn is weird |
robin-drexler
left a comment
There was a problem hiding this comment.
This is amazing. I haven't (yet) looked into how the sausage is made exactly, but the test experience looks good at a glance!
| ); | ||
|
|
||
| beforeEach(() => { | ||
| extension.setUp(); |

Follow up to #3899 that adds a complete, type-safe mock of the Customer Account extension API
👁️ How to review this PR