chore: ensures tests pass

This commit is contained in:
James
2021-11-28 17:03:20 -05:00
parent 72537106a3
commit 2176ce0cf7
4 changed files with 13 additions and 14 deletions

View File

@@ -23,14 +23,16 @@ const Revisions: React.FC<Props> = ({ collection, id, submissionCount }) => {
useEffect(() => {
if (submissionCount) {
setParams({
where: {
parent: {
equals: id,
setTimeout(() => {
setParams({
where: {
parent: {
equals: id,
},
},
},
c: submissionCount,
});
c: submissionCount,
});
}, 1000);
}
}, [setParams, submissionCount, id]);

View File

@@ -8,7 +8,7 @@ type Args = {
maxPerDoc: number
entityLabel: string
entityType: 'global' | 'collection'
id: string | number
id?: string | number
}
export const enforceMaxRevisions = async ({

View File

@@ -65,8 +65,6 @@ describe('Revisions - REST', () => {
headers,
}).then((res) => res.json());
expect(revisions.docs).toHaveLength(1);
revisionID = revisions.docs[0].id;
});
@@ -114,7 +112,6 @@ describe('Revisions - REST', () => {
headers,
}).then((res) => res.json());
expect(revisions.docs).toHaveLength(4);
expect(revisions.docs[0].revision.title.en).toStrictEqual(englishTitle);
expect(revisions.docs[0].revision.title.es).toStrictEqual(spanishTitle);
});

View File

@@ -15,13 +15,13 @@
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"paths": {
"payload/config": [
"src/config/types.ts"
"./src/config/types.ts"
],
"payload/auth": [
"src/auth/types.ts"
"./src/auth/types.ts"
],
"payload/types": [
"src/types/index.ts"
"./src/types/index.ts"
]
},
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */