diff options
Diffstat (limited to 'spec/frontend/projects/commit_box/info/load_branches_spec.js')
-rw-r--r-- | spec/frontend/projects/commit_box/info/load_branches_spec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/frontend/projects/commit_box/info/load_branches_spec.js b/spec/frontend/projects/commit_box/info/load_branches_spec.js index e49d92188ed..b00a6378e07 100644 --- a/spec/frontend/projects/commit_box/info/load_branches_spec.js +++ b/spec/frontend/projects/commit_box/info/load_branches_spec.js @@ -4,6 +4,9 @@ import { setHTMLFixture } from 'helpers/fixtures'; import waitForPromises from 'helpers/wait_for_promises'; import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status'; import { loadBranches } from '~/projects/commit_box/info/load_branches'; +import { initDetailsButton } from '~/projects/commit_box/info/init_details_button'; + +jest.mock('~/projects/commit_box/info/init_details_button'); const mockCommitPath = '/commit/abcd/branches'; const mockBranchesRes = @@ -26,6 +29,13 @@ describe('~/projects/commit_box/info/load_branches', () => { mock.onGet(mockCommitPath).reply(HTTP_STATUS_OK, mockBranchesRes); }); + it('initializes the details button', async () => { + loadBranches(); + await waitForPromises(); + + expect(initDetailsButton).toHaveBeenCalled(); + }); + it('loads and renders branches info', async () => { loadBranches(); await waitForPromises(); |