chore(feature-flags): Sales Channels enabled by default (#2966)
This commit is contained in:
@@ -81,128 +81,3 @@ Object {
|
||||
"offset": 0,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`/admin/batch-jobs GET /admin/batch-jobs lists batch jobs created by the user and where completed_at is null 1`] = `
|
||||
Object {
|
||||
"batch_jobs": Array [
|
||||
Object {
|
||||
"canceled_at": null,
|
||||
"completed_at": null,
|
||||
"confirmed_at": null,
|
||||
"context": Object {},
|
||||
"created_at": Any<String>,
|
||||
"created_by": "admin_user",
|
||||
"deleted_at": null,
|
||||
"dry_run": false,
|
||||
"failed_at": null,
|
||||
"id": "job_3",
|
||||
"pre_processed_at": null,
|
||||
"processing_at": null,
|
||||
"result": null,
|
||||
"status": "created",
|
||||
"type": "product-export",
|
||||
"updated_at": Any<String>,
|
||||
},
|
||||
Object {
|
||||
"canceled_at": null,
|
||||
"completed_at": null,
|
||||
"confirmed_at": null,
|
||||
"context": Object {},
|
||||
"created_at": Any<String>,
|
||||
"created_by": "admin_user",
|
||||
"deleted_at": null,
|
||||
"dry_run": false,
|
||||
"failed_at": null,
|
||||
"id": "job_2",
|
||||
"pre_processed_at": null,
|
||||
"processing_at": null,
|
||||
"result": null,
|
||||
"status": "created",
|
||||
"type": "product-export",
|
||||
"updated_at": Any<String>,
|
||||
},
|
||||
Object {
|
||||
"canceled_at": null,
|
||||
"completed_at": null,
|
||||
"confirmed_at": null,
|
||||
"context": Object {},
|
||||
"created_at": Any<String>,
|
||||
"created_by": "admin_user",
|
||||
"deleted_at": null,
|
||||
"dry_run": false,
|
||||
"failed_at": null,
|
||||
"id": "job_1",
|
||||
"pre_processed_at": null,
|
||||
"processing_at": null,
|
||||
"result": null,
|
||||
"status": "created",
|
||||
"type": "product-export",
|
||||
"updated_at": Any<String>,
|
||||
},
|
||||
],
|
||||
"count": 3,
|
||||
"limit": 10,
|
||||
"offset": 0,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`/admin/batch-jobs POST /admin/batch-jobs/ Creates a batch job 1`] = `
|
||||
Object {
|
||||
"canceled_at": null,
|
||||
"completed_at": null,
|
||||
"confirmed_at": null,
|
||||
"context": Object {
|
||||
"list_config": Object {
|
||||
"order": Object {
|
||||
"created_at": "DESC",
|
||||
},
|
||||
"relations": Array [
|
||||
"variants",
|
||||
"variants.prices",
|
||||
"variants.options",
|
||||
"images",
|
||||
"options",
|
||||
"tags",
|
||||
"type",
|
||||
"collection",
|
||||
"variants.prices.region",
|
||||
],
|
||||
"skip": 0,
|
||||
"take": 50,
|
||||
},
|
||||
},
|
||||
"created_at": Any<String>,
|
||||
"created_by": "admin_user",
|
||||
"deleted_at": null,
|
||||
"dry_run": false,
|
||||
"failed_at": null,
|
||||
"id": Any<String>,
|
||||
"pre_processed_at": null,
|
||||
"processing_at": null,
|
||||
"result": null,
|
||||
"status": "created",
|
||||
"type": "product-export",
|
||||
"updated_at": Any<String>,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`/admin/batch-jobs POST /admin/batch-jobs/:id/cancel Cancels batch job created by the user 1`] = `
|
||||
Object {
|
||||
"canceled_at": Any<String>,
|
||||
"completed_at": null,
|
||||
"confirmed_at": null,
|
||||
"context": Object {},
|
||||
"created_at": Any<String>,
|
||||
"created_by": "admin_user",
|
||||
"deleted_at": null,
|
||||
"dry_run": false,
|
||||
"failed_at": null,
|
||||
"id": "job_1",
|
||||
"pre_processed_at": null,
|
||||
"processing_at": null,
|
||||
"result": null,
|
||||
"status": "canceled",
|
||||
"type": "product-export",
|
||||
"updated_at": Any<String>,
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -123,28 +123,30 @@ describe("/admin/batch-jobs", () => {
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data.batch_jobs.length).toEqual(3)
|
||||
expect(response.data).toMatchSnapshot({
|
||||
batch_jobs: [
|
||||
{
|
||||
id: "job_3",
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
created_by: "admin_user",
|
||||
},
|
||||
{
|
||||
id: "job_2",
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
created_by: "admin_user",
|
||||
},
|
||||
{
|
||||
id: "job_1",
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
created_by: "admin_user",
|
||||
},
|
||||
],
|
||||
})
|
||||
expect(response.data).toEqual(
|
||||
expect.objectContaining({
|
||||
batch_jobs: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "job_3",
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
created_by: "admin_user",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "job_2",
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
created_by: "admin_user",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "job_1",
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
created_by: "admin_user",
|
||||
}),
|
||||
]),
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -207,13 +209,15 @@ describe("/admin/batch-jobs", () => {
|
||||
)
|
||||
|
||||
expect(response.status).toEqual(201)
|
||||
expect(response.data.batch_job).toMatchSnapshot({
|
||||
created_by: "admin_user",
|
||||
status: "created",
|
||||
id: expect.any(String),
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
})
|
||||
expect(response.data.batch_job).toEqual(
|
||||
expect.objectContaining({
|
||||
created_by: "admin_user",
|
||||
status: "created",
|
||||
id: expect.any(String),
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -272,12 +276,14 @@ describe("/admin/batch-jobs", () => {
|
||||
)
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data.batch_job).toMatchSnapshot({
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
canceled_at: expect.any(String),
|
||||
status: "canceled",
|
||||
})
|
||||
expect(response.data.batch_job).toEqual(
|
||||
expect.objectContaining({
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
canceled_at: expect.any(String),
|
||||
status: "canceled",
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
it("Fails to cancel a batch job created by a different user", async () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const path = require("path")
|
||||
const fs = require("fs/promises")
|
||||
import { resolve, sep } from "path"
|
||||
import { simpleSalesChannelFactory } from "../../../factories"
|
||||
|
||||
const setupServer = require("../../../../helpers/setup-server")
|
||||
const { useApi } = require("../../../../helpers/use-api")
|
||||
@@ -49,6 +50,11 @@ describe("Batch job of product-export type", () => {
|
||||
await productSeeder(dbConnection)
|
||||
await adminSeeder(dbConnection)
|
||||
await userSeeder(dbConnection)
|
||||
|
||||
await simpleSalesChannelFactory(dbConnection, {
|
||||
id: "test-channel",
|
||||
is_default: true,
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in New Issue
Block a user