Skip to content

Commit

Permalink
Remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevazhnovu committed Jan 8, 2025
1 parent 11e5fac commit e816a3c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,69 +166,6 @@ class SPClientCoordinatorSpec: QuickSpec {
.toEventually(equal("bar"))
}
}

describe("reportAction") {
beforeEach {
spClientMock = SourcePointClientMock(
accountId: accountId,
propertyName: propertyName,
propertyId: propertyId,
campaignEnv: .Public,
timeout: 999
)
coordinator = coordinatorFor(campaigns: gdprCcpaCampaigns, spClient: spClientMock)
}

it("should include right payload for GDPR") {
let gdprAction = SPAction(
type: .AcceptAll,
campaignType: .gdpr,
messageId: "1234"
)
gdprAction.encodablePubData = ["foo": .init("gdpr")]
let publisherData = JsonKt.encodeToJsonObject(gdprAction.encodablePubData.toCore())

waitUntil { done in
coordinator.reportAction(gdprAction) { response in
switch response {
case .failure: fail("failed reporting gdpr action")

case .success:
expect(spClientMock.postGDPRActionCalled).to(beTrue())
let request = spClientMock.postGDPRActionCalledWith?["request"] as? GDPRChoiceRequest
expect(request?.pubData).to(equal(publisherData))
expect(request?.messageId).to(equal("1234"))
}
done()
}
}
}

it("should include the right payload for CCPA") {
let ccpaAction = SPAction(
type: .AcceptAll,
campaignType: .ccpa,
messageId: "321"
)
ccpaAction.encodablePubData = ["foo": .init("ccpa")]
let publisherData = JsonKt.encodeToJsonObject(ccpaAction.encodablePubData.toCore())

waitUntil { done in
coordinator.reportAction(ccpaAction) { response in
switch response {
case .failure: fail("failed reporting ccpa action")

case .success:
expect(spClientMock.postCCPAActionCalled).to(beTrue())
let request = spClientMock.postCCPAActionCalledWith?["request"] as? CCPAChoiceRequest
expect(request?.pubData).to(equal(publisherData))
expect(request?.messageId).to(equal("321"))
}
done()
}
}
}
}
}

describe("consent-status") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,61 +224,5 @@ class UnmockedSourcepointClientSpec: QuickSpec {
}
}
}

describe("choice/reject-all") {
it("should call the endpoint and parse the response into ChoiceAllResponse") {
waitUntil { done in
client.choiceAll(
actionType: .rejectall,
campaigns: .init(
gdpr: .init(applies: true),
ccpa: .init(applies: true),
usnat: .init(applies: true)
)
) { result in
switch result {
case .success(let response):
expect(response).to(beAnInstanceOf(ChoiceAllResponse.self))
expect(response.gdpr).notTo(beNil())
expect(response.gdpr?.acceptedCategories).to(beEmpty())
expect(response.ccpa).notTo(beNil())
expect(response.usnat).notTo(beNil())

case .failure(let error):
fail(error.description)
}
done()
}
}
}
}

describe("choice/consent-all") {
it("should call the endpoint and parse the response into ChoiceAllResponse") {
waitUntil { done in
client.choiceAll(
actionType: .acceptall,
campaigns: .init(
gdpr: .init(applies: true),
ccpa: .init(applies: true),
usnat: .init(applies: true)
)
) { result in
switch result {
case .success(let response):
expect(response).to(beAnInstanceOf(ChoiceAllResponse.self))
expect(response.gdpr).notTo(beNil())
expect(response.gdpr?.acceptedCategories).notTo(beEmpty())
expect(response.ccpa).notTo(beNil())
expect(response.usnat).notTo(beNil())

case .failure(let error):
fail(error.description)
}
done()
}
}
}
}
}
}

0 comments on commit e816a3c

Please sign in to comment.