(t *testing.T)
| 1820 | } |
| 1821 | |
| 1822 | func TestMergeRun_disableAutoMerge(t *testing.T) { |
| 1823 | ios, _, stdout, stderr := iostreams.Test() |
| 1824 | ios.SetStdoutTTY(true) |
| 1825 | ios.SetStderrTTY(true) |
| 1826 | |
| 1827 | tr := initFakeHTTP() |
| 1828 | defer tr.Verify(t) |
| 1829 | tr.Register( |
| 1830 | httpmock.GraphQL(`mutation PullRequestAutoMergeDisable\b`), |
| 1831 | httpmock.GraphQLQuery(`{}`, func(s string, m map[string]any) { |
| 1832 | assert.Equal(t, map[string]any{"prID": "THE-ID"}, m) |
| 1833 | })) |
| 1834 | |
| 1835 | _, cmdTeardown := run.Stub() |
| 1836 | defer cmdTeardown(t) |
| 1837 | |
| 1838 | err := mergeRun(&MergeOptions{ |
| 1839 | IO: ios, |
| 1840 | HttpClient: func() (*http.Client, error) { |
| 1841 | return &http.Client{Transport: tr}, nil |
| 1842 | }, |
| 1843 | SelectorArg: "https://github.com/OWNER/REPO/pull/123", |
| 1844 | AutoMergeDisable: true, |
| 1845 | Finder: shared.NewMockFinder( |
| 1846 | "https://github.com/OWNER/REPO/pull/123", |
| 1847 | &api.PullRequest{ID: "THE-ID", Number: 123}, |
| 1848 | ghrepo.New("OWNER", "REPO"), |
| 1849 | ), |
| 1850 | }) |
| 1851 | assert.NoError(t, err) |
| 1852 | |
| 1853 | assert.Equal(t, "", stdout.String()) |
| 1854 | assert.Equal(t, "✓ Auto-merge disabled for pull request OWNER/REPO#123\n", stderr.String()) |
| 1855 | } |
| 1856 | |
| 1857 | func TestPrInMergeQueue(t *testing.T) { |
| 1858 | http := initFakeHTTP() |
nothing calls this directly
no test coverage detected