From 3540a53a5c84a7f305ed61cf5fdf1ac81b8957fd Mon Sep 17 00:00:00 2001 From: Scott Nath Date: Tue, 5 Mar 2024 10:59:49 -0500 Subject: [PATCH] Update user.stories.js --- src/github/user/user.stories.js | 122 ++++++++++++++++---------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/src/github/user/user.stories.js b/src/github/user/user.stories.js index b88e5d3..ec97e4e 100644 --- a/src/github/user/user.stories.js +++ b/src/github/user/user.stories.js @@ -62,70 +62,70 @@ export const UserRepos = { } } -// export const PopularUser = { -// args: parseFetchedUser(userSindresorhus), -// play: User.play, -// } +export const PopularUser = { + args: parseFetchedUser(userSindresorhus), + play: User.play, +} -// export const OnlyRequired = { -// args: { -// login: userScottnath.login, -// name: userScottnath.name, -// }, -// play: User.play, -// } +export const OnlyRequired = { + args: { + login: userScottnath.login, + name: userScottnath.name, + }, + play: User.play, +} -// export const Fetch = { -// args: { -// login: userScottnath.login, -// fetch: true, -// }, -// parameters: { -// fetchMock: { -// mocks: [ -// { -// response: generateMockResponse(userScottnath, 'users'), -// } -// ] -// } -// }, -// play: async ({ args, canvasElement, step }) => { -// const elements = await getElements(canvasElement); -// const argsAfterFetch = { -// ...parseFetchedUser({...userScottnath}), -// ...args, -// }; -// await ensureElements(elements, argsAfterFetch); -// await ensureScreenRead(elements, argsAfterFetch); -// } -// }; +export const Fetch = { + args: { + login: userScottnath.login, + fetch: true, + }, + parameters: { + fetchMock: { + mocks: [ + { + response: generateMockResponse(userScottnath, 'users'), + } + ] + } + }, + play: async ({ args, canvasElement, step }) => { + const elements = await getElements(canvasElement); + const argsAfterFetch = { + ...parseFetchedUser({...userScottnath}), + ...args, + }; + await ensureElements(elements, argsAfterFetch); + await ensureScreenRead(elements, argsAfterFetch); + } +}; -// export const FetchOverides = { -// args: { -// login: userScottnath.login, -// fetch: true, -// name: "Meowy McMeowerstein", -// bio: "Spending time purring and sleepin", -// avatar_url: 'cat-square.jpeg', -// followers: "500000", -// following: "2980", -// repos: stringify([{"full_name":"scottnath/profile-components","description":"Cool thing, does stuff","language":"HTML"}]) -// }, -// parameters: { -// mockData: [ -// generateMockResponse(userScottnath, 'users'), -// ] -// }, -// play: async ({ args, canvasElement, step }) => { -// const elements = await getElements(canvasElement); -// const argsAfterFetch = { -// ...parseFetchedUser({...userScottnath}), -// ...args, -// }; -// await ensureElements(elements, argsAfterFetch); -// await ensureScreenRead(elements, argsAfterFetch); -// } -// } +export const FetchOverides = { + args: { + login: userScottnath.login, + fetch: true, + name: "Meowy McMeowerstein", + bio: "Spending time purring and sleepin", + avatar_url: 'cat-square.jpeg', + followers: "500000", + following: "2980", + repos: stringinator([{"full_name":"scottnath/profile-components","description":"Cool thing, does stuff","language":"HTML"}]) + }, + parameters: { + mockData: [ + generateMockResponse(userScottnath, 'users'), + ] + }, + play: async ({ args, canvasElement, step }) => { + const elements = await getElements(canvasElement); + const argsAfterFetch = { + ...parseFetchedUser({...userScottnath}), + ...args, + }; + await ensureElements(elements, argsAfterFetch); + await ensureScreenRead(elements, argsAfterFetch); + } +} // export const ReposFetch = { // args: {