Skip to content

Commit da4b4a1

Browse files
committed
feat: add frontend tests
1 parent 745c068 commit da4b4a1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

amplify-migration-apps/mood-board/tests/api.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,32 @@ describe('guest', () => {
247247
guest().graphql({ query: getKinesisEvents }),
248248
).rejects.toBeDefined();
249249
});
250+
251+
describe('resolver overrides', () => {
252+
it('listBoards prepends pin emoji to board names', async () => {
253+
const name = `Override Test ${Date.now()}`;
254+
await guest().graphql({
255+
query: createBoard,
256+
variables: { input: { name } },
257+
});
258+
259+
const listResult = await guest().graphql({ query: listBoards });
260+
const items = (listResult as any).data.listBoards.items;
261+
const found = items.find((b: any) => b.name === `📌 ${name}`);
262+
263+
expect(found).toBeDefined();
264+
});
265+
266+
it('listBoards caps results at 50 even when higher limit is requested', async () => {
267+
const listResult = await guest().graphql({
268+
query: listBoards,
269+
variables: { limit: 100 },
270+
});
271+
const items = (listResult as any).data.listBoards.items;
272+
273+
expect(items.length).toBeLessThanOrEqual(50);
274+
});
275+
});
250276
});
251277

252278
describe('auth', () => {

0 commit comments

Comments
 (0)