-
Notifications
You must be signed in to change notification settings - Fork 78
Tests/sdk 1556/pt unit tests #811
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
Tests/sdk 1556/pt unit tests #811
Conversation
…onName, getTimeStamp, loadImageRidIntoRemoteView
…Extras, getDeepLinkListFromExtras, getBigTextFromExtras, getSmallTextFromExtras, getPriceFromExtras
…tEventNameFromExtras
WalkthroughThe changes update utility methods to accept the current timestamp as an explicit argument instead of obtaining it internally. Corresponding method calls in notification rendering and content view classes are updated to pass the current system time. Related unit tests are adjusted to match the new method signatures and target updated Android SDK versions. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller (Renderer/ContentView/Receiver)
participant Utils
Caller->>Utils: getTimeStamp(context, System.currentTimeMillis())
Utils-->>Caller: Returns formatted timestamp string
Caller->>Utils: getTimerEnd(extras, System.currentTimeMillis())
Utils-->>Caller: Returns timer end value (int)
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🔇 Additional comments (8)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/UtilsTest.kt
Outdated
Show resolved
Hide resolved
clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/UtilsTest.kt
Outdated
Show resolved
Hide resolved
@coderabbitai review |
✅ Actions performedReview triggered.
|
f7c09fb
into
task/SDK-1556/replace_multi_layouts_with_dimens
* task(SDK-1556) - Deletes all v19 layouts since minSDKVersion is 21 * task(SDK-1556) - Deletes files in v22 and v23 that are same as v21 * task(SDK-1556) - Deletes files in v22 that are same as v21 * task(SDK-1556) - Deletes files in v31 that are same as default folder * task(SDK-1556) - Fixes manual_carousel in default folder and deletes redundant file in v31 * task(SDK-4057) - Makes v21 layouts as the default layouts Also removes redundant attributes like marginLeft which were needed for v17 * task(SDK-4057) - Replaces redundant layout files with different dimensions * task(SDK-4057) - Replaces for five cta, redundant layout files with different dimensions * task(SDK-4057) - Introduces pt_render_terminal to render the final notification - Some refactoring - Introduces key * task(SDK-4536) - Fixes negative value for timer template - Changes support for timer template to Android O and above - Updates docs * task(SDK-4465) - Adds prefix pt_ to res files of push-templates to avoid conflicts - Also removes redundant attributes * task(SDK-4465) - Changes marginLeft to marginStart - Changes marginRight to marginEnd * Task/sdk 4595/replicate standard and basic (#788) * task(SDK-4595) - Replicate Standard Android Notification with Basic Push Template - Changes in dimens - Removes redundant styles.xml for sw-400 * task(SDK-4595) - Fixes color * task(SDK-1556) - Makes timer margin and padding same as other templates * fix(SDK-1556) - fixes zero bezel on API 31 and above * Task/sdk 4048/ctas pt (#786) * POC for FG service based timer notif * task(SDK-4048) - Adds CTAs in the remote view for push templates below API level 31 * task(SDK-4048) - Reverts rating view changes * Rename .java to .kt * task(SDK-4048) - Adds action buttons to remote view - For API 31 and above StyleWithActionButtons is responsible - For API 30 and below ActionButtonsContentView is responsible * task(SDK-4048) - Resolves comments - Makes classes internal - Removes redundant colour attribute - Adds pt_ prefix * task(SDK-4048) - Resolves comments - Removes return@forEach * task(SDK-4048) - Resolves comments - Adds extension function to increase readability * task(SDK-4048) - Resolves comments - Removes public access modifier * task(SDK-4048) - Testing - Adds UTs for TemplateRenderer * task(SDK-4537) - Removes extra space from manual_carousel.xml (#794) - Removes padding from shape and adds margin * task(SDK-4048) - Removes dependency from core-sdk * task(SDK-4040) - Adds CTA for manual carousel * task(SDK-4040) - Adds CTA for auto carousel * task(SDK-4048) - Compresses forward and backward arrows for manual carousel * task(SDK-4048) - Separates PendingIntent from ActionButton.kt * task(SDK-4048) - Uses composition instead of inheritance for action buttons * task(SDK-4048) - Fixes image in rating template * task(SDK-4048) - Fixes string resource name * task(SDK-4048) - Fixes rating template padding * task(SDK-4048) - Minor PR comments * task(SDK-4655) - Dark mode for push templates (#795) * task(SDK-4655) - Dark mode for push templates - Adds dark mode support for push templates - Removes bg as mandatory key - Parses colour based on dark mode of phone * task(SDK-4655) - Addresses few todos * task(SDK-4655) - Makes product display action colour optional * task(SDK-4655) - Addresses todos * task(SDK-4655) -Fixes typo and deletes redundant files * task(SDK-4655) - Color for CTA in clicked state * task(SDK-4655) - Fixes default colour for title * task(SDK-4655) - Fixes default colour for small icon * task(SDK-4655) - Adds color for rating confirm button for light and dark mode * task(SDK-4655) - Fixes default colour for product template buttons * task(SDK-4655) - Extracts dimens * task(SDK-4655) - Improves code reuse by refactoring setting of colours * task(SDK-4655) - Improves code reuse by refactoring dark mode colors * task(SDK-4834) - Makes image in notification configurable for scaletype (#808) * task(SDK-4834) - Makes image in notification configurable for scaletype * task(SDK-4834) - Improves code reuse by refactoring dark mode colors * task(SDK-4834) - Minor PR comments * task(SDK-1556) - Fixes tests * Tests/sdk 1556/pt unit tests (#811) * task(SDK-1556) - Adds test for getFlipInterval * task(SDK-1556) - Adds test for getColour * task(SDK-1556) - Adds test for createColourMap * task(SDK-1556) - Adds test for getFallback, getTimerEnd, getApplicationName, getTimeStamp, loadImageRidIntoRemoteView * task(SDK-1556) - Adds test for getImageListFromExtras, getCTAListFromExtras, getDeepLinkListFromExtras, getBigTextFromExtras, getSmallTextFromExtras, getPriceFromExtras * task(SDK-1556) - Adds test for convertRatingBundleObjectToHashMap, getEventNameFromExtras * task(SDK-1556) - Adds test for getEventPropertiesFromExtras * task(SDK-1556) - Adds test * task(SDK-1556) - Adds test for raiseNotificationClicked, getActionKeys * task(SDK-1556) - Adds test for raiseNotificationClicked * task(SDK-1556) - Adds test for deleteImageFromStorage * task(SDK-1556) - Adds test for isNotificationChannelEnabled * task(SDK-1556) - Adds test * task(SDK-1556) - Adds test for getTimerThreshold * task(SDK-1556) - Adds test for fromJson * task(SDK-1556) - Adds test for loadImageUrLIntoRemoteView * tests(SDK-1556) - Improves timer template test * tests(SDK-1556) - Improves timer template test * task(SDK-1556) - Improves tests and Utils function * task(SDK-1556) - Moves mockkStatic inside a code-block * task(SDK-1556) - Minor improvements around dot sep (#815) * task(SDK-1556) - Minor improvements around dot sep * task(SDK-1556) - Minor colour improvement * task(SDK-1556) - Minor improvements around message summary for timer template * task(SDK-1556) - Coderabbit pr comments * task(SDK-1556) - Fixes flaky test * docs(SDK-1556) - CHANGELOG and version upgrade for PT (#814) * docs(SDK-1556) - CHANGELOG and version upgrade for PT * task(SDK-1556) - Improves docs and updates dates * task(SDK-1556) - copyTemplates * docs(SDK-1556) - Improves changelog
Summary by CodeRabbit