feat(core): Support importing a singular workflow object (#14041)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Mike Arvela
2025-03-19 11:12:40 +02:00
committed by GitHub
parent 6817abe47f
commit 91b27964d8
3 changed files with 123 additions and 19 deletions

View File

@@ -100,6 +100,37 @@ test('import:workflow should import active workflow from combined file and deact
});
});
test('import:workflow can import a single workflow object', async () => {
//
// ARRANGE
//
const owner = await createOwner();
const ownerProject = await getPersonalProject(owner);
//
// ACT
//
await command.run(['--input=./test/integration/commands/import-workflows/combined/single.json']);
//
// ASSERT
//
const after = {
workflows: await getAllWorkflows(),
sharings: await getAllSharedWorkflows(),
};
expect(after).toMatchObject({
workflows: [expect.objectContaining({ name: 'active-workflow', active: false })],
sharings: [
expect.objectContaining({
workflowId: '998',
projectId: ownerProject.id,
role: 'workflow:owner',
}),
],
});
});
test('`import:workflow --userId ...` should fail if the workflow exists already and is owned by somebody else', async () => {
//
// ARRANGE