Skip to content

Commit 2ea65d3

Browse files
committed
fix(V2): scope live-api XLSX round-trip to home org
With governance sync enabled, /v2/project and /v2/unit XLSX exports included projects and units owned by other organizations. The Step 15 round-trip re-import staged UPDATEs for every exported row, so the ownership guard rejected the foreign rows and the import returned 400. Export and compare only home-org data (orgUid=me) in the round-trip and fidelity checks, matching the existing Step 16 home-org export pattern, so the re-import only touches records the home org can modify.
1 parent daccd2a commit 2ea65d3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/v2/live-api/xlsx-import-export.live.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ describe('XLSX Import/Export Live API Tests', function () {
466466
it('should export and re-import project XLSX', async function () {
467467
const exportResponse = await request
468468
.get('/v2/project')
469-
.query({ xls: 'true' })
469+
.query({ xls: 'true', orgUid: 'me' })
470470
.buffer(true)
471471
.parse((res, callback) => {
472472
const chunks = [];
@@ -478,7 +478,7 @@ describe('XLSX Import/Export Live API Tests', function () {
478478

479479
const beforeResponse = await request
480480
.get('/v2/project')
481-
.query({ page: 1, limit: 1000 });
481+
.query({ page: 1, limit: 1000, orgUid: 'me' });
482482
beforeProjects = beforeResponse.body?.data || beforeResponse.body || [];
483483

484484
const importResponse = await request
@@ -492,7 +492,7 @@ describe('XLSX Import/Export Live API Tests', function () {
492492
it('should export and re-import unit XLSX', async function () {
493493
const exportResponse = await request
494494
.get('/v2/unit')
495-
.query({ xls: 'true' })
495+
.query({ xls: 'true', orgUid: 'me' })
496496
.buffer(true)
497497
.parse((res, callback) => {
498498
const chunks = [];
@@ -504,7 +504,7 @@ describe('XLSX Import/Export Live API Tests', function () {
504504

505505
const beforeResponse = await request
506506
.get('/v2/unit')
507-
.query({ page: 1, limit: 1000 });
507+
.query({ page: 1, limit: 1000, orgUid: 'me' });
508508
beforeUnits = beforeResponse.body?.data || beforeResponse.body || [];
509509

510510
const importResponse = await request
@@ -526,7 +526,7 @@ describe('XLSX Import/Export Live API Tests', function () {
526526
it('should verify projects match after round-trip', async function () {
527527
const afterResponse = await request
528528
.get('/v2/project')
529-
.query({ page: 1, limit: 1000 });
529+
.query({ page: 1, limit: 1000, orgUid: 'me' });
530530
const afterProjects = afterResponse.body?.data || afterResponse.body || [];
531531

532532
expect(afterProjects.length).to.equal(beforeProjects.length);
@@ -545,7 +545,7 @@ describe('XLSX Import/Export Live API Tests', function () {
545545
it('should verify units match after round-trip', async function () {
546546
const afterResponse = await request
547547
.get('/v2/unit')
548-
.query({ page: 1, limit: 1000 });
548+
.query({ page: 1, limit: 1000, orgUid: 'me' });
549549
const afterUnits = afterResponse.body?.data || afterResponse.body || [];
550550

551551
expect(afterUnits.length).to.equal(beforeUnits.length);

0 commit comments

Comments
 (0)