Skip to content

Commit

Permalink
chore: fix dataconnect integration tests (#2736)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahirumaramba authored Oct 23, 2024
1 parent 58b1a36 commit 032f2da
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/integration/data-connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ chai.use(chaiAsPromised);

const expect = chai.expect;

/*
// Schema
type User @table(key: "uid") {
uid: String!
name: String!
address: String!
}
type Email @table {
subject: String!
date: Date!
text: String!
from: User!
}
*/

interface UserResponse {
user: {
name: string;
Expand Down Expand Up @@ -59,7 +75,7 @@ interface EmailsResponse {
}

interface UserVariables {
id: string;
id: { uid: string };
}

const connectorConfig: ConnectorConfig = {
Expand Down Expand Up @@ -117,7 +133,7 @@ describe('getDataConnect()', () => {
it('executeGraphql() successfully executes a GraphQL query with variables', async () => {
const resp = await getDataConnect(connectorConfig).executeGraphql<UserResponse, UserVariables>(
queryGetUserById,
{ variables: { id: userId } }
{ variables: { id: { uid: userId } } }
);
expect(resp.data.user.name).to.be.not.undefined;
expect(resp.data.user.uid).equals(userId);
Expand Down

0 comments on commit 032f2da

Please sign in to comment.