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
amp-date-countdown component #15453
amp-date-countdown component #15453
Conversation
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.
Docs LGTM
} | ||
attrs: { | ||
name: "offset-seconds" | ||
value_regex: "-?\\d{1,}" |
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.
Optionally, you could shorten {1,}
to +
.
Validator changes look good, thanks! (Small regex suggestion in the protoascii.) |
@leonalicious This is getting very close, I see couple of unit tests failures (related to this component). We can merge as soon as they are fixed and build is green. Thanks for all the work on this component! |
it was working previously, and i have tried to fix this for last couple of days, seems like the connection between For instance, based on my understanding
it was working previously, now is not working, if there are any simple example would be much appreciate |
@aghassemi please help, i have uploaded my |
// element.build(); | ||
// let timeObj; | ||
// let itemElement; | ||
// Services.viewerForDoc(win.document).whenFirstVisible().then(() => { |
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.
because this test is async
you need to add a return
here and return the promise
so that the test runner knows to wait.
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 did add a return
here, but then it will stuck there and return error
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
the thing is it will never go inside the function, not sure why , and then i did try another approach in the last 2 test cases
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.
looks like you are stubbing the whenFirstVisible
above in test setup and keeping a reference under viewer
variable so
return viewer.whenFirstVisible().then() {
});
whenFirstVisiblePromiseResolve();
should work.
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.
nope, still not working as expected
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.
feel free to skip for now to get the PR in, we can fix later.
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.
Okay, already commented them out , and the rest of the test scripts are passed !
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.
@leonalicious there seems to be a conflict in gulp.js
after that's resolved and build is green, we can merge. Thanks for all the work
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.
here you go, should be resolved by now~
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.
a new unit test failure (32:7 error 'whenFirstVisiblePromiseResolve' is assigned a value but never used. Allowed unused vars must match /AmpElement|Def|Interface$/ no-unused-vars
)
(we are constantly improving our lint/jsdoc rules so that is why these issues keep coming up, so as you rebase and try to merge PR, there might be new rules to adhere to that did not exist before. Apologies for the inconvenience this causes but needed for code quality improvements)
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 do run sudo gulp pr-check
and notice there are too many errors which flood my entire command screen and i couldn't not pin-point and check on amp-date-countdown
properly. but i guess all linter check should be achieved by now~
@leonalicious Merged! Thanks so much for contributing this new component to AMP and for you patience through the review and approval process. |
It is our pleasure to contribute the component and giving it back to the community ~ |
(previously mostly reviewed via PR #13657)
MVP:
end-date
,timestamp-ms
,timestamp-seconds
is required, else error message. -Done
offset-seconds
- Donelocale
- DoneTo be confirmed: