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

Update failed tests #15

Merged
merged 1 commit into from
Mar 29, 2024
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
20 changes: 12 additions & 8 deletions tests/api/ipapolicies/ipapolicies.post.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test.describe("List IPAPolicies @IPAPolicies", async () => {
for (const { pagination } of pageParams) {
test(`Should return IPAPolicies list with pagination ${JSON.stringify(
pagination
)} @bug`, async ({ request }) => {
)}`, async ({ request }) => {
const payload = {
options: { pagination: pagination },
};
Expand Down Expand Up @@ -71,7 +71,7 @@ test.describe("List IPAPolicies @IPAPolicies", async () => {
{ orderBy: "blockTimestamp", orderDirection: "asc" },
];
for (const { orderBy, orderDirection } of orderParams) {
test(`Should return IPAPolicies list ordered by ${orderBy} ${orderDirection} @bug`, async ({
test(`Should return IPAPolicies list ordered by ${orderBy} ${orderDirection}`, async ({
request,
}) => {
const payload = {
Expand All @@ -86,8 +86,14 @@ test.describe("List IPAPolicies @IPAPolicies", async () => {
expect(errors).toBeUndefined();
expect(data.length).toBeGreaterThan(0);
for (let i = 0; i < data.length - 1; i++) {
const item = data[i][orderBy].trim() || "\uFFFF";
const nextItem = data[i + 1][orderBy].trim() || "\uFFFF";
const item =
typeof data[i][orderBy] === "string"
? data[i][orderBy].trim() || "\uFFFF"
: data[i][orderBy];
const nextItem =
typeof data[i + 1][orderBy] === "string"
? data[i + 1][orderBy].trim() || "\uFFFF"
: data[i + 1][orderBy];
if (orderDirection === "asc") {
expect(item <= nextItem).toBeTruthy();
} else {
Expand All @@ -112,9 +118,7 @@ test.describe("List IPAPolicies @IPAPolicies", async () => {
for (const { pagination, orderBy, orderDirection } of pageAndOrderParams) {
test(`Should return IPAPolicies list with pagination ${JSON.stringify(
pagination
)} and ordered by ${orderBy} ${orderDirection} @bug`, async ({
request,
}) => {
)} and ordered by ${orderBy} ${orderDirection}`, async ({ request }) => {
const payload = {
options: {
pagination: pagination,
Expand Down Expand Up @@ -213,7 +217,7 @@ test.describe("List IPAPolicies @IPAPolicies", async () => {
}
});

test("Should return IPAPolicies list with pagination, orders and filters", async ({
test("Should return IPAPolicies list with pagination, orders and filters @bug", async ({
request,
ipapolicies,
}) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/api/permissions/permissions.get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ApiPrefix } from "../../constants";
const endpoint = ApiPrefix + "/permissions";

test.describe("Get a Permission @Permissions", async () => {
test("Should return Permissions detail", async ({
test("Should return Permissions detail @bug", async ({
request,
permissionsList,
}) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/api/royalties/royalties.splits.get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ApiPrefix } from "../../constants";
const endpoint = ApiPrefix + "/royalties/splits";

test.describe("Get a Royalties Split @Royalties", () => {
test("Should return Royalties Split detail", async ({
test("Should return Royalties Split detail @bug", async ({
request,
royaltiesPolicies,
}) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/api/transactions/transactions.post.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ test.describe("List Transactions @Transactions", async () => {
},
{
where: {
actionType: transactions[1].actionType,
actionType: transactions[0].actionType,
resourceId: transactions[0].resourceId,
},
orderBy: "ipId",
Expand Down
Loading