Skip to content

Commit

Permalink
feat: add grantee upload/download test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferenc Sárai committed Jun 28, 2024
1 parent 6cd923a commit 4083d31
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/integration/modules/bzz.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ describe('ACT', () => {
const data = 'hello act'
let publicKey: string
let batchID: BatchId
const grantees =[
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12e8",
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12e9",
"02ceff1422a7026ba54ad89967d81f2805a55eb3d05f64eb5c49ea6024212b12ee",
]

before(async () => {
publicKey = (
Expand Down Expand Up @@ -70,6 +75,21 @@ describe('ACT', () => {
const dFile = await bzz.downloadFile(requestOptionsOK, result.reference, filename)
expect(Buffer.from(dFile.data).toString()).to.eql(data)
})

it('should upload grantee list', async function () {
const response = await bzz.addGrantees(BEE_KY_OPTIONS, batchID, grantees )
expect(response.ref).to.have.lengthOf(128)
expect(response.historyref).to.have.lengthOf(64)
})

it('should download grantee list', async function () {
const response = await bzz.addGrantees(BEE_KY_OPTIONS, batchID, grantees )
const list = await bzz.getGrantees(response.ref, BEE_KY_OPTIONS)
expect(list.data).to.have.lengthOf(grantees.length)
list.data.forEach((element: any, index: number) => {
expect(grantees.includes(element)).to.be.true;
})
})
})

describe('modules/bzz', () => {
Expand Down

0 comments on commit 4083d31

Please sign in to comment.