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

EP-180: Create Properties (Phase 5) #1175

Merged
merged 10 commits into from
Mar 24, 2021

Conversation

sunday-okpoluaefe
Copy link
Contributor

@sunday-okpoluaefe sunday-okpoluaefe commented Mar 19, 2021

📲 What

Android: Create Properties (Phase 5)

🤔 Why

Segment Implementation

🛠 How

  • Added project_prelaunch_activated to project Properties HashMap
project.prelaunchActivated()?.let { put("project_prelaunch_activated", it) }

  • Add unit testing to new property
 @Test
    fun testProjectProperties_hasProject_prelaunch_activated() {
        val project = ProjectFactory.projectWithAddOns()

        val client = client(null)
        client.eventNames.subscribe(this.segmentTrack)
        client.eventProperties.subscribe(this.propertiesTest)
        val segment = AnalyticEvents(listOf(client))

        segment.trackProjectPageViewed(ProjectDataFactory.project(project, RefTag.discovery(), RefTag.recommended()), PledgeFlowContext.NEW_PLEDGE)

        val expectedProperties = this.propertiesTest.value
        assertNotNull(expectedProperties["project_prelaunch_activated"])
    }
@Test
    fun testProjectProperties_hasProject_prelaunch_activated_true() {
        val project = ProjectFactory.projectWithAddOns()
                .toBuilder()
                .prelaunchActivated(true)
                .build()
        val client = client(null)
        client.eventNames.subscribe(this.segmentTrack)
        client.eventProperties.subscribe(this.propertiesTest)
        val segment = AnalyticEvents(listOf(client))
        segment.trackProjectPageViewed(ProjectDataFactory.project(project, RefTag.discovery(), RefTag.recommended()), PledgeFlowContext.NEW_PLEDGE)
        val expectedProperties = this.propertiesTest.value
        assertNotNull(expectedProperties["project_prelaunch_activated"])
        assertEquals(true, expectedProperties["project_prelaunch_activated"])
    }
  @Test
    fun testProjectProperties_hasProject_prelaunch_activated_false() {
        val project = ProjectFactory.projectWithAddOns()
                .toBuilder()
                .prelaunchActivated(false)
                .build()
        val client = client(null)
        client.eventNames.subscribe(this.segmentTrack)
        client.eventProperties.subscribe(this.propertiesTest)
        val segment = AnalyticEvents(listOf(client))
        segment.trackProjectPageViewed(ProjectDataFactory.project(project, RefTag.discovery(), RefTag.recommended()), PledgeFlowContext.NEW_PLEDGE)
        val expectedProperties = this.propertiesTest.value
        assertNotNull(expectedProperties["project_prelaunch_activated"])
        assertEquals(false, expectedProperties["project_prelaunch_activated"])
    }

Screenshot 2021-03-23 at 19 40 07

👀 See

Screenshot 2021-03-19 at 19 56 45

Before 🐛 After 🦋

📋 QA

Instructions for anyone to be able to QA this work.

Story 📖

https://kickstarter.atlassian.net/browse/EP-180

Copy link
Contributor

@Arkariang Arkariang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some testing around the new added property on SegmentTest.kt

@sunday-okpoluaefe
Copy link
Contributor Author

add some testing around the new added property on SegmentTest.kt

done

Copy link
Contributor

@Arkariang Arkariang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sunday-okpoluaefe sunday-okpoluaefe merged commit 7bd1b8c into master Mar 24, 2021
@sunday-okpoluaefe sunday-okpoluaefe deleted the sunday/EP-180-create-project-properties branch March 24, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants