Skip to content

Commit

Permalink
test(ardrive): remove owner assertion tests PE-6155
Browse files Browse the repository at this point in the history
  • Loading branch information
fedellen committed May 20, 2024
1 parent 18b06cc commit fc3ba7d
Showing 1 changed file with 0 additions and 165 deletions.
165 changes: 0 additions & 165 deletions tests/integration/ardrive.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ describe('ArDrive class - integrated', () => {
);

const walletOwner = stubArweaveAddress();
const unexpectedOwner = stubArweaveAddress('0987654321klmnopqrxtuvwxyz123456789ABCDEFGH');

// Use copies to expose any issues with object equality in tested code
const expectedDriveId = EID(stubEntityID.toString());
const unexpectedDriveId = EID(stubEntityIDAlt.toString());
Expand Down Expand Up @@ -831,17 +829,6 @@ describe('ArDrive class - integrated', () => {
});
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.createPublicFolder({
folderName: validEntityName,
driveId: stubEntityID,
parentFolderId: stubEntityID
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if the folder name conflicts with another ENTITY name in the destination folder', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.createPublicFolder({
Expand Down Expand Up @@ -928,18 +915,6 @@ describe('ArDrive class - integrated', () => {
});
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.createPrivateFolder({
folderName: validEntityName,
driveId: stubEntityID,
parentFolderId: stubEntityID,
driveKey: await getStubDriveKey()
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if the folder name conflicts with another ENTITY name in the destination folder', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.createPrivateFolder({
Expand Down Expand Up @@ -1010,18 +985,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPublicEntityNamesInFolder').resolves(['CONFLICTING_NAME']);
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(unexpectedOwner);

await expectAsyncErrorThrow({
promiseToError: arDrive.movePublicFolder({
folderId: stubEntityID,
newParentFolderId: stubEntityIDAlt
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if the folder name conflicts with another ENTITY name in the destination folder', async () => {
stub(arfsDao, 'getPublicFolder').resolves(stubPublicFolder({ folderName: 'CONFLICTING_NAME' }));
stub(arfsDao, 'getOwnerForDriveId').resolves(walletOwner);
Expand Down Expand Up @@ -1164,19 +1127,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPrivateEntityNamesInFolder').resolves(['CONFLICTING_NAME']);
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(unexpectedOwner);

await expectAsyncErrorThrow({
promiseToError: arDrive.movePrivateFolder({
folderId: stubEntityID,
newParentFolderId: stubEntityIDAlt,
driveKey: await getStubDriveKey()
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if the folder name conflicts with another ENTITY name in the destination folder', async () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(walletOwner);
stub(arfsDao, 'getPrivateFolder').returns(stubPrivateFolder({ folderName: 'CONFLICTING_NAME' }));
Expand Down Expand Up @@ -1411,16 +1361,6 @@ describe('ArDrive class - integrated', () => {
});
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.uploadPublicFile({
parentFolderId: EID(stubEntityID.toString()),
wrappedFile
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if destination folder has a conflicting FOLDER name', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.uploadPublicFile({
Expand Down Expand Up @@ -1669,17 +1609,6 @@ describe('ArDrive class - integrated', () => {
});
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.uploadPrivateFile({
parentFolderId: EID(stubEntityID.toString()),
wrappedFile,
driveKey: await getStubDriveKey()
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if destination folder has a conflicting FOLDER name', async () => {
await expectAsyncErrorThrow({
promiseToError: arDrive.uploadPrivateFile({
Expand Down Expand Up @@ -1890,18 +1819,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPublicEntityNamesInFolder').resolves(['CONFLICTING_NAME']);
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(unexpectedOwner);

await expectAsyncErrorThrow({
promiseToError: arDrive.movePublicFile({
fileId: stubEntityID,
newParentFolderId: stubEntityIDAlt
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if the destination folder has a conflicting entity name', async () => {
stub(arfsDao, 'getPublicFile').resolves(stubPublicFile({ fileName: 'CONFLICTING_NAME' }));
stub(arfsDao, 'getOwnerForDriveId').resolves(walletOwner);
Expand Down Expand Up @@ -1969,19 +1886,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPrivateEntityNamesInFolder').resolves(['CONFLICTING_NAME']);
});

it('throws an error if the owner of the drive conflicts with supplied wallet', async () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(unexpectedOwner);

await expectAsyncErrorThrow({
promiseToError: arDrive.movePrivateFile({
fileId: stubEntityID,
newParentFolderId: stubEntityIDAlt,
driveKey: await getStubDriveKey()
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws an error if the destination folder has a conflicting entity name', async () => {
stub(arfsDao, 'getPrivateFile').returns(stubPrivateFile({ fileName: 'CONFLICTING_NAME' }));
stub(arfsDao, 'getOwnerForDriveId').resolves(walletOwner);
Expand Down Expand Up @@ -2059,17 +1963,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPublicEntityNamesInFolder').resolves([stubFileName, conflictingName]);
});

it('throws if the owner mismatches', () => {
stub(arfsDao, 'getDriveOwnerForFileId').resolves(unexpectedOwner);
return expectAsyncErrorThrow({
promiseToError: arDrive.renamePublicFile({
fileId: stubEntityID,
newName: validEntityName
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws if the given name is the same as the current one', () => {
stub(arfsDao, 'getDriveOwnerForFileId').resolves(walletOwner);
return expectAsyncErrorThrow({
Expand Down Expand Up @@ -2172,18 +2065,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPrivateEntityNamesInFolder').resolves([stubFileName, conflictingName]);
});

it('throws if the owner mismatches', async () => {
stub(arfsDao, 'getDriveOwnerForFileId').resolves(unexpectedOwner);
return expectAsyncErrorThrow({
promiseToError: arDrive.renamePrivateFile({
fileId: stubEntityID,
newName: validEntityName,
driveKey: await stubDriveKey
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws if the given name is the same as the current one', async () => {
stub(arfsDao, 'getDriveOwnerForFileId').resolves(walletOwner);
return expectAsyncErrorThrow({
Expand Down Expand Up @@ -2291,17 +2172,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPublicEntityNamesInFolder').resolves([stubFileName, conflictingName]);
});

it('throws if the owner mismatches', () => {
stub(arfsDao, 'getDriveOwnerForFolderId').resolves(unexpectedOwner);
return expectAsyncErrorThrow({
promiseToError: arDrive.renamePublicFolder({
folderId: stubEntityID,
newName: validEntityName
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws if the given name is the same as the current one', () => {
stub(arfsDao, 'getDriveOwnerForFolderId').resolves(walletOwner);
return expectAsyncErrorThrow({
Expand Down Expand Up @@ -2404,18 +2274,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPrivateEntityNamesInFolder').resolves([stubFileName, conflictingName]);
});

it('throws if the owner mismatches', async () => {
stub(arfsDao, 'getDriveOwnerForFolderId').resolves(unexpectedOwner);
return expectAsyncErrorThrow({
promiseToError: arDrive.renamePrivateFolder({
folderId: stubEntityID,
newName: validEntityName,
driveKey: await stubDriveKey
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws if the given name is the same as the current one', async () => {
stub(arfsDao, 'getDriveOwnerForFolderId').resolves(walletOwner);
return expectAsyncErrorThrow({
Expand Down Expand Up @@ -2523,17 +2381,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPublicEntityNamesInFolder').resolves([stubDriveName, conflictingName]);
});

it('throws if the owner mismatches', () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(unexpectedOwner);
return expectAsyncErrorThrow({
promiseToError: arDrive.renamePublicDrive({
driveId: stubEntityID,
newName: validEntityName
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws if the given name is the same as the current one', () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(walletOwner);
return expectAsyncErrorThrow({
Expand Down Expand Up @@ -2625,18 +2472,6 @@ describe('ArDrive class - integrated', () => {
stub(arfsDao, 'getPrivateEntityNamesInFolder').resolves([stubDriveName, conflictingName]);
});

it('throws if the owner mismatches', async () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(unexpectedOwner);
return expectAsyncErrorThrow({
promiseToError: arDrive.renamePrivateDrive({
driveId: stubEntityID,
newName: validEntityName,
driveKey: await stubDriveKey
}),
errorMessage: 'Supplied wallet is not the owner of this drive!'
});
});

it('throws if the given name is the same as the current one', async () => {
stub(arfsDao, 'getOwnerForDriveId').resolves(walletOwner);
return expectAsyncErrorThrow({
Expand Down

0 comments on commit fc3ba7d

Please sign in to comment.