Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class GetConsentsMock {
),
isEssential = false,
category = "marketing",
isExempt = false,
)
)

Expand All @@ -41,7 +42,8 @@ internal class GetConsentsMock {
"status" to false
)
),
"category" to "marketing"
"category" to "marketing",
"isExempt" to false
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ internal class SaveDecisionsForTCFMock {
),
isEssential = false,
category = "marketing",
isExempt = false,
)
)

Expand Down Expand Up @@ -86,7 +87,8 @@ internal class SaveDecisionsForTCFMock {
"status" to false
)
),
"category" to "marketing"
"category" to "marketing",
"isExempt" to false
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ internal fun UsercentricsServiceConsent.toWritableMap(): WritableMap {
putBoolean("isEssential", isEssential)
putArray("history", history.toWritableArray())
putString("category", category)
putBoolean("isExempt", isExempt)
}
}

Expand Down
3 changes: 2 additions & 1 deletion ios/Extensions/UsercentricsServiceConsents+Dict.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public extension UsercentricsServiceConsent {
"dataProcessor": self.dataProcessor,
"isEssential": self.isEssential,
"history": self.history.toDictionary(),
"category": self.category
"category": self.category,
"isExempt": self.isExempt
]

if let type = self.type?.ordinal {
Expand Down
3 changes: 2 additions & 1 deletion sample/ios/sampleTests/Mock/UsercentricsIsReady+Mock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ extension UsercentricsServiceConsent {
dataProcessor: "BBBB",
version: "1.2.3",
isEssential: false,
category: "marketing")
category: "marketing",
isExempt: false)
}
}

Expand Down
9 changes: 6 additions & 3 deletions sample/ios/sampleTests/ReadyStatusDictTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class ReadyStatusDictTests: XCTestCase {
dataProcessor: "abc",
version: "version",
isEssential: true,
category: "marketing")
category: "marketing",
isExempt: false)
Comment thread
uc-brunosilva marked this conversation as resolved.

let usercentricsReady = UsercentricsReadyStatus(shouldCollectConsent: false,
consents: [consent],
Expand Down Expand Up @@ -43,7 +44,8 @@ class ReadyStatusDictTests: XCTestCase {
dataProcessor: "abc",
version: "version",
isEssential: false,
category: "marketing").toDictionary()
category: "marketing",
isExempt: false).toDictionary()

XCTAssertEqual("abc", consent["templateId"] as! String)
XCTAssertEqual(true, consent["status"] as! Bool)
Expand All @@ -60,7 +62,8 @@ class ReadyStatusDictTests: XCTestCase {
dataProcessor: "abc",
version: "version",
isEssential: false,
category: "marketing").toDictionary()
category: "marketing",
isExempt: false).toDictionary()

XCTAssertEqual(1, consentImplicit["type"] as! Int)
}
Expand Down
12 changes: 8 additions & 4 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ describe('Test Usercentrics Module', () => {
timestampInMillis: 123.0,
type: 0
}],
category: "essemtial"
category: "essemtial",
Comment thread
uc-brunosilva marked this conversation as resolved.
isExempt: false,
Comment thread
uc-brunosilva marked this conversation as resolved.
}
],
{
Expand Down Expand Up @@ -202,7 +203,8 @@ describe('Test Usercentrics Module', () => {
timestampInMillis: 123.0,
type: 0
}],
category: "essemtial"
category: "essemtial",
isExempt: false,
}
]
)
Expand Down Expand Up @@ -270,7 +272,8 @@ describe('Test Usercentrics Module', () => {
timestampInMillis: 123.0,
type: 0
}],
category: "essemtial"
category: "essemtial",
isExempt: false,
}
],
{
Expand Down Expand Up @@ -579,7 +582,8 @@ describe('Test Usercentrics Module', () => {
timestampInMillis: 123.0,
type: 0
Comment thread
uc-brunosilva marked this conversation as resolved.
}],
category: "essemtial"
category: "essemtial",
isExempt: false,
}
],
{
Expand Down
4 changes: 3 additions & 1 deletion src/models/UsercentricsServiceConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export class UsercentricsServiceConsent {
isEssential: boolean
history: UsercentricsConsentHistoryEntry[]
category: string
isExempt: boolean

constructor(templateId: string, status: boolean, dataProcessor: string, version: string, type: UsercentricsConsentType, isEssential: boolean, history: UsercentricsConsentHistoryEntry[], category: string) {
constructor(templateId: string, status: boolean, dataProcessor: string, version: string, type: UsercentricsConsentType, isEssential: boolean, history: UsercentricsConsentHistoryEntry[], category: string, isExempt: boolean = false) {
Comment thread
uc-brunosilva marked this conversation as resolved.
Comment thread
uc-brunosilva marked this conversation as resolved.
this.templateId = templateId
this.status = status
this.dataProcessor = dataProcessor
Expand All @@ -20,6 +21,7 @@ export class UsercentricsServiceConsent {
this.isEssential = isEssential
this.history = history
this.category = category;
this.isExempt = isExempt;
Comment thread
uc-brunosilva marked this conversation as resolved.
}
}

Expand Down
Loading