Skip to content

chore: fix data connect integration tests #2736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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