Skip to content

Commit c71354b

Browse files
committed
fix sortBy changes + pretty
1 parent d0e1563 commit c71354b

File tree

137 files changed

+18162
-17514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+18162
-17514
lines changed

__tests__/CampaignsApi.spec.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { Campaign, CampaignWritable, CampaignUpdatable, CmpScheduleType } from "../models";
1+
import {
2+
Campaign,
3+
CampaignWritable,
4+
CampaignUpdatable,
5+
CmpScheduleType,
6+
} from "../models";
27
import { CampaignsApi } from "../api/campaigns-api";
38
import { CONFIG_FOR_INTEGRATION } from "./testFixtures";
49

@@ -55,7 +60,9 @@ describe("CampaignsApi", () => {
5560
updates
5661
);
5762
expect(updatedCampaign).toBeDefined();
58-
expect(updatedCampaign.description).toEqual("TS Integration Test Updated Campaign");
63+
expect(updatedCampaign.description).toEqual(
64+
"TS Integration Test Updated Campaign"
65+
);
5966

6067
// Delete
6168
const deletedCampaign = await campaignsApi.delete(
@@ -126,7 +133,10 @@ describe("CampaignsApi", () => {
126133
});
127134

128135
it("lists campaigns given include param", async () => {
129-
const response = await new CampaignsApi(CONFIG_FOR_INTEGRATION).list(undefined, ["total_count"]);
136+
const response = await new CampaignsApi(CONFIG_FOR_INTEGRATION).list(
137+
undefined,
138+
["total_count"]
139+
);
130140
expect(response.data).toBeDefined();
131141
expect(response.total_count).toBeDefined();
132142
});
@@ -141,7 +151,12 @@ describe("CampaignsApi", () => {
141151
)
142152
.split("=")[1];
143153

144-
const responseAfter = await campaignsApi.list(10, undefined, undefined, after);
154+
const responseAfter = await campaignsApi.list(
155+
10,
156+
undefined,
157+
undefined,
158+
after
159+
);
145160
expect(responseAfter.data).toBeDefined();
146161
expect(responseAfter.previous_url).toBeDefined();
147162
expect(responseAfter.previous_url).not.toBeNull();

__tests__/CampaignsApi.unit.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
CampaignUpdatable,
33
CampaignWritable,
4-
CmpScheduleType
4+
CmpScheduleType,
55
} from "../models";
66
import { CampaignsApi } from "../api/campaigns-api";
77

@@ -145,7 +145,9 @@ describe("CampaignsApi", () => {
145145
data: { id: "cmp_fakeId" },
146146
}));
147147

148-
const campaigns = await new CampaignsApi(CONFIG_FOR_UNIT).get("cmp_fakeId");
148+
const campaigns = await new CampaignsApi(CONFIG_FOR_UNIT).get(
149+
"cmp_fakeId"
150+
);
149151
expect(campaigns).toBeDefined();
150152
expect(campaigns.id).toEqual("cmp_fakeId");
151153
});
@@ -436,7 +438,7 @@ describe("CampaignsApi", () => {
436438

437439
const campaignsApi = await new CampaignsApi(CONFIG_FOR_UNIT).list(
438440
1, // limit
439-
["total_count"], // include
441+
["total_count"] // include
440442
);
441443
expect(campaignsApi).toBeDefined();
442444
expect(campaignsApi.data?.length).toBeLessThanOrEqual(1);

__tests__/CardsApi.unit.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,10 @@ describe("CardsApi", () => {
462462
}));
463463

464464
const cardsApi = await new CardsApi(CONFIG_FOR_UNIT).list(
465-
1,
466-
"fake",
467-
"id",
468-
{
469-
id: "asc",
470-
}
465+
1, // limit
466+
"fake", // before
467+
"id", // after
468+
["total_count"] // include
471469
);
472470
expect(cardsApi).toBeDefined();
473471
expect(cardsApi.data?.length).toEqual(1);

__tests__/MiscellaneousModels.unit.ts

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {
99
SortBy1,
1010
SortBy2,
1111
SortBy3,
12-
SortBy4,
13-
SortBy5,
1412
SortByDateCreatedEnum,
1513
SortBySendDateEnum,
1614
SortBy1DateCreatedEnum,
@@ -19,10 +17,6 @@ import {
1917
SortBy2SendDateEnum,
2018
SortBy3DateCreatedEnum,
2119
SortBy3SendDateEnum,
22-
SortBy4DateCreatedEnum,
23-
SortBy4SendDateEnum,
24-
SortBy5DateCreatedEnum,
25-
SortBy5SendDateEnum,
2620
Thumbnail,
2721
CountryExtended,
2822
TrackingEventCertified,
@@ -576,50 +570,6 @@ describe("Sort Criteria", () => {
576570
expect((rec as any)[prop]).toEqual(val);
577571
});
578572
});
579-
580-
describe("SortBy4", () => {
581-
it("can be created", () => {
582-
const rec = new SortBy4();
583-
expect(rec).toBeDefined();
584-
});
585-
586-
it.each([
587-
["date_created", SortBy4DateCreatedEnum.Asc],
588-
["date_created", SortBy4DateCreatedEnum.Desc],
589-
["send_date", SortBy4SendDateEnum.Asc],
590-
["send_date", SortBy4SendDateEnum.Desc],
591-
])("can be created with a provided %s value", (prop, val) => {
592-
const input = {};
593-
(input as any)[prop] = val;
594-
595-
const rec = new SortBy4(input);
596-
597-
expect(rec).toBeDefined();
598-
expect((rec as any)[prop]).toEqual(val);
599-
});
600-
});
601-
602-
describe("SortBy5", () => {
603-
it("can be created", () => {
604-
const rec = new SortBy5();
605-
expect(rec).toBeDefined();
606-
});
607-
608-
it.each([
609-
["date_created", SortBy5DateCreatedEnum.Asc],
610-
["date_created", SortBy5DateCreatedEnum.Desc],
611-
["send_date", SortBy5SendDateEnum.Asc],
612-
["send_date", SortBy5SendDateEnum.Desc],
613-
])("can be created with a provided %s value", (prop, val) => {
614-
const input = {};
615-
(input as any)[prop] = val;
616-
617-
const rec = new SortBy5(input);
618-
619-
expect(rec).toBeDefined();
620-
expect((rec as any)[prop]).toEqual(val);
621-
});
622-
});
623573
});
624574

625575
describe("Location", () => {

0 commit comments

Comments
 (0)