|
| 1 | +import { LoggedInUser, SourceFile } from '../../src/apiTypes'; |
| 2 | + |
1 | 3 | describe('Forking', () => { |
2 | 4 | describe('When you do not own the file', () => { |
3 | 5 | it('Should allow you to fork it', () => { |
4 | 6 | cy.setMockAuthToken(); |
5 | | - cy.interceptGraphQL({ |
6 | | - getLoggedInUser: { |
7 | | - id: 'id', |
8 | | - }, |
9 | | - getSourceFile: { |
10 | | - id: 'source-file-id', |
| 7 | + cy.interceptAPI<LoggedInUser>({ |
| 8 | + id: 'id', |
| 9 | + }); |
| 10 | + |
| 11 | + cy.interceptAPI<SourceFile>({ |
| 12 | + id: 'source-file-id', |
| 13 | + text: '// Source file', |
| 14 | + project: { |
11 | 15 | owner: { |
12 | 16 | id: 'some-other-id', |
13 | 17 | }, |
14 | | - text: '// Source file', |
15 | 18 | }, |
16 | | - forkSourceFile: { |
17 | | - id: 'source-file-id-2', |
| 19 | + }); |
| 20 | + cy.interceptAPI<SourceFile>({ |
| 21 | + id: 'source-file-id-2', |
| 22 | + project: { |
18 | 23 | name: 'Source File', |
19 | 24 | owner: { |
20 | 25 | id: 'id', |
@@ -43,19 +48,22 @@ describe('Forking', () => { |
43 | 48 | describe('When you do own the file', () => { |
44 | 49 | it('Should allow you to fork it', () => { |
45 | 50 | cy.setMockAuthToken(); |
46 | | - cy.interceptGraphQL({ |
47 | | - getLoggedInUser: { |
48 | | - id: 'user-id', |
49 | | - }, |
50 | | - getSourceFile: { |
51 | | - id: 'source-file-id', |
| 51 | + cy.interceptAPI<LoggedInUser>({ |
| 52 | + id: 'user-id', |
| 53 | + }); |
| 54 | + |
| 55 | + cy.interceptAPI<SourceFile>({ |
| 56 | + id: 'source-file-id', |
| 57 | + text: '// Source file', |
| 58 | + project: { |
52 | 59 | owner: { |
53 | 60 | id: 'user-id', |
54 | 61 | }, |
55 | | - text: '// Source file', |
56 | 62 | }, |
57 | | - forkSourceFile: { |
58 | | - id: 'source-file-id-2', |
| 63 | + }); |
| 64 | + cy.interceptAPI<SourceFile>({ |
| 65 | + id: 'source-file-id-2', |
| 66 | + project: { |
59 | 67 | name: 'Source File', |
60 | 68 | owner: { |
61 | 69 | id: 'user-id', |
|
0 commit comments