diff --git a/packages/client/api.ts b/packages/client/api.ts index 047ecdf6..a40a16c3 100644 --- a/packages/client/api.ts +++ b/packages/client/api.ts @@ -167,10 +167,12 @@ export class MainAPI { } public async query(query: dm.SignedQuery): Promise { + const bytes = getCodec(dm.SignedQuery).encode(query) return this.http .getFetch()(urlJoinPath(this.http.toriiBaseURL, ENDPOINT_QUERY), { method: 'POST', - body: [getCodec(dm.SignedQuery).encode(query)], + // FIXME: see `transaction` method, same issue + body: bytes as unknown as BodyInit, }) .then(handleQueryResponse) } diff --git a/tests/browser/cypress/e2e/main.cy.ts b/tests/browser/cypress/e2e/main.cy.ts index e15a3539..6ab4478c 100644 --- a/tests/browser/cypress/e2e/main.cy.ts +++ b/tests/browser/cypress/e2e/main.cy.ts @@ -9,7 +9,9 @@ it('Register new domain and wait until commitment', () => { // wait for the genesis block cy.get('h3').contains('Status').closest('div').contains('Blocks: 2') - cy.get('button').contains('Listen').click().contains('Stop') + cy.get('button').contains('Listen').click() + cy.get('li.active-events').contains('Events: true') + cy.get('li.active-blocks').contains('Blocks: true') cy.get('input').type('bob') cy.get('button').contains('Register domain').click() @@ -21,10 +23,26 @@ it('Register new domain and wait until commitment', () => { const EXPECTED_EVENTS = 8 // And all events are caught - cy.get('ul.events-list') + cy.get('ul.events') .children('li') .should('have.length', EXPECTED_EVENTS) .last() - .contains('Block') + .contains('Block (height=4)') .contains('Applied') + + // And all blocks too + cy.get('ul.blocks') + .children('li') + .should('have.length', 4) + .first().contains('1') + .parent() + .last().contains('4') + + cy.get('button').contains('Query domains').click() + + // our registered domain appears + cy.get('ul.domains') + .children('li') + .should('have.length', 3) + .first().contains('bob') }) diff --git a/tests/browser/src/App.vue b/tests/browser/src/App.vue index c1e24152..5d56c9c8 100644 --- a/tests/browser/src/App.vue +++ b/tests/browser/src/App.vue @@ -1,7 +1,8 @@