Download spectrum/api/test/message/queries.test.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 837 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/test/message/queries.test.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/test/message/queries.test.js
-
curl -L -o queries.test.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/test/message/queries.test.js
837 Bytes
| // @flow | |
| import { request } from '../utils'; | |
| import data from 'shared/testing/data'; | |
| it('should fetch a message', async () => { | |
| const query = /* GraphQL */ ` | |
| { | |
| message(id: "${data.messages[0].id}") { | |
| id | |
| timestamp | |
| content { | |
| body | |
| } | |
| messageType | |
| } | |
| } | |
| `; | |
| expect.hasAssertions(); | |
| const result = await request(query); | |
| expect(result).toMatchSnapshot(); | |
| }); | |
| describe('sender', () => { | |
| it('should fetch a user', async () => { | |
| const query = /* GraphQL */ ` | |
| { | |
| message(id: "${data.messages[0].id}") { | |
| author { | |
| id | |
| user { | |
| username | |
| } | |
| } | |
| } | |
| } | |
| `; | |
| expect.hasAssertions(); | |
| const result = await request(query); | |
| expect(result).toMatchSnapshot(); | |
| }); | |
| }); | |