add integration test on global search resolver (#11007)
closes https://github.com/twentyhq/core-team-issues/issues/580
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
export const LISTING_NAME_SINGULAR = 'listing';
|
||||
export const LISTING_NAME_PLURAL = 'listings';
|
||||
@ -1,10 +1,12 @@
|
||||
import {
|
||||
LISTING_NAME_PLURAL,
|
||||
LISTING_NAME_SINGULAR,
|
||||
} from 'test/integration/metadata/suites/object-metadata/constants/test-object-names.constant';
|
||||
import { createOneObjectMetadataFactory } from 'test/integration/metadata/suites/object-metadata/utils/create-one-object-metadata-factory.util';
|
||||
import { makeMetadataAPIRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
|
||||
|
||||
const LISTING_NAME_SINGULAR = 'listing';
|
||||
|
||||
const LISTING_OBJECT = {
|
||||
namePlural: 'listings',
|
||||
namePlural: LISTING_NAME_PLURAL,
|
||||
nameSingular: LISTING_NAME_SINGULAR,
|
||||
labelPlural: 'Listings',
|
||||
labelSingular: 'Listing',
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { makeMetadataAPIRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
|
||||
|
||||
export const findManyObjectsMetadataItems = async () => {
|
||||
const query = {
|
||||
query: gql`
|
||||
query ObjectMetadataItems {
|
||||
objects(paging: { first: 1000 }) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
nameSingular
|
||||
namePlural
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
};
|
||||
|
||||
const response = await makeMetadataAPIRequest(query);
|
||||
|
||||
return response.body.data.objects.edges.map((edge) => edge.node) as {
|
||||
id: string;
|
||||
nameSingular: string;
|
||||
namePlural: string;
|
||||
}[];
|
||||
};
|
||||
Reference in New Issue
Block a user