Skip to content

Commit

Permalink
Remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevazhnovu committed Nov 22, 2024
1 parent 28a1b99 commit c600a9d
Showing 1 changed file with 0 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,168 +153,6 @@ class SourcePointClientSpec: QuickSpec {
expect(httpClient.getWasCalledWithUrl).toEventually(contain("/v2/messages"))
}
}

describe("choiceAll") {
it("should contain the correct query params") {
let includeData = IncludeData.standard
client.choiceAll(
actionType: .AcceptAll,
accountId: 123,
propertyId: 321,
idfaStatus: .accepted,
metadata: .init(gdpr: .init(applies: true), ccpa: .init(applies: false), usnat: .init(applies: false)),
includeData: includeData
) { _ in }
let choiceAllUrl = URL(string: httpClient.getWasCalledWithUrl!)
expect(choiceAllUrl).to(
containQueryParams([
"accountId": "123",
"hasCsp": "true",
"propertyId": "321",
"withSiteActions": "false",
"includeCustomVendorsRes": "false",
"idfaStatus": "accepted",
"metadata": #"{"ccpa":{"applies":false},"gdpr":{"applies":true},"usnat":{"applies":false}}"#
])
)
expect(choiceAllUrl).to(containQueryParam("includeData"))
}
}

describe("postAction") {
describe("gdpr") {
it("calls post on the http client with the right url") {
client.postGDPRAction(
actionType: .AcceptAll,
body: .init(
authId: nil,
uuid: nil,
messageId: nil,
consentAllRef: nil,
vendorListId: nil,
pubData: [:],
pmSaveAndExitVariables: nil,
sendPVData: true,
propertyId: 0,
sampleRate: 1,
idfaStatus: nil,
granularStatus: .init(),
includeData: .standard
)
) { _ in }
expect(httpClient.postWasCalledWithUrl) == "https://\(self.wrapperHost)/wrapper/v2/choice/gdpr/11?env=prod"
}

it("calls POST on the http client with the right body") {
let body = GDPRChoiceBody(
authId: nil,
uuid: nil,
messageId: nil,
consentAllRef: nil,
vendorListId: nil,
pubData: [:],
pmSaveAndExitVariables: nil,
sendPVData: true,
propertyId: 0,
sampleRate: 1,
idfaStatus: nil,
granularStatus: .init(),
includeData: .standard
)
client.postGDPRAction(
actionType: .AcceptAll,
body: body
) { _ in }
let encoded = try JSONEncoder().encode(body)
expect(httpClient.postWasCalledWithBody!).to(equal(encoded))
}
}

describe("ccpa") {
it("calls post on the http client with the right url") {
client.postCCPAAction(
actionType: .AcceptAll,
body: .init(
authId: nil,
uuid: nil,
messageId: "",
pubData: [:],
pmSaveAndExitVariables: nil,
sendPVData: true,
propertyId: 1,
sampleRate: 1,
includeData: .standard
)
) { _ in }
expect(httpClient.postWasCalledWithUrl) == "https://\(self.wrapperHost)/wrapper/v2/choice/ccpa/11?env=prod"
}

it("calls POST on the http client with the right body") {
let body = CCPAChoiceBody(
authId: nil,
uuid: nil,
messageId: "",
pubData: [:],
pmSaveAndExitVariables: nil,
sendPVData: true,
propertyId: 1,
sampleRate: 1,
includeData: .standard
)
client.postCCPAAction(
actionType: .AcceptAll,
body: body
) { _ in }
let encoded = try JSONEncoder().encode(body)
expect(httpClient.postWasCalledWithBody!).to(equal(encoded))
}
}
describe("usnat") {
it("calls post on the http client with the right url") {
client.postUSNatAction(
actionType: .AcceptAll,
body: .init(
authId: nil,
uuid: nil,
messageId: "",
vendorListId: nil,
pubData: [:],
pmSaveAndExitVariables: nil,
sendPVData: true,
propertyId: 1,
sampleRate: 1,
idfaStatus: nil,
granularStatus: nil,
includeData: .standard
)
) { _ in }
expect(httpClient.postWasCalledWithUrl) == "https://\(self.wrapperHost)/wrapper/v2/choice/usnat/11?env=prod"
}

it("calls POST on the http client with the right body") {
let body = USNatChoiceBody(
authId: nil,
uuid: nil,
messageId: "",
vendorListId: nil,
pubData: [:],
pmSaveAndExitVariables: nil,
sendPVData: true,
propertyId: 1,
sampleRate: 1,
idfaStatus: nil,
granularStatus: nil,
includeData: .standard
)
client.postUSNatAction(
actionType: .AcceptAll,
body: body
) { _ in }
let encoded = try JSONEncoder().encode(body)
expect(httpClient.postWasCalledWithBody!).to(equal(encoded))
}
}
}
}
}
}

0 comments on commit c600a9d

Please sign in to comment.