|
13 | 13 | /* eslint-disable @typescript-eslint/no-non-null-assertion */
|
14 | 14 |
|
15 | 15 | import { FACTORY_LINK_ATTR } from '@eclipse-che/common';
|
16 |
| -import { AlertVariant } from '@patternfly/react-core'; |
17 | 16 | import { cleanup, screen, waitFor } from '@testing-library/react';
|
18 | 17 | import userEvent, { UserEvent } from '@testing-library/user-event';
|
19 | 18 | import React from 'react';
|
@@ -695,31 +694,6 @@ describe('Creating steps, fetching a devfile', () => {
|
695 | 694 | const protocol = 'http://';
|
696 | 695 | const factoryUrl = 'git@github.com:user/repository-name.git';
|
697 | 696 | const emptyStore = new MockStoreBuilder().build();
|
698 |
| - const sshPrivateRepoAllertItem = expect.objectContaining({ |
699 |
| - title: 'Warning', |
700 |
| - variant: AlertVariant.warning, |
701 |
| - children: ( |
702 |
| - <ExpandableWarning |
703 |
| - textBefore="Devfile resolve from a privatre repositry via an SSH url is not supported." |
704 |
| - errorMessage="Could not reach devfile" |
705 |
| - textAfter="Apply a Personal Access Token to fetch the devfile.yaml content." |
706 |
| - /> |
707 |
| - ), |
708 |
| - actionCallbacks: [ |
709 |
| - expect.objectContaining({ |
710 |
| - title: 'Continue with default devfile', |
711 |
| - callback: expect.any(Function), |
712 |
| - }), |
713 |
| - expect.objectContaining({ |
714 |
| - title: 'Reload', |
715 |
| - callback: expect.any(Function), |
716 |
| - }), |
717 |
| - expect.objectContaining({ |
718 |
| - title: 'Open Documentation page', |
719 |
| - callback: expect.any(Function), |
720 |
| - }), |
721 |
| - ], |
722 |
| - }); |
723 | 697 |
|
724 | 698 | let spyWindowLocation: jest.SpyInstance;
|
725 | 699 | let location: Location;
|
@@ -771,32 +745,32 @@ describe('Creating steps, fetching a devfile', () => {
|
771 | 745 | expect(mockOnError).not.toHaveBeenCalled();
|
772 | 746 | });
|
773 | 747 |
|
774 |
| - it('should show warning on SSH url', async () => { |
| 748 | + it('should use default devfile on private SSH url', async () => { |
775 | 749 | searchParams = new URLSearchParams({
|
776 | 750 | [FACTORY_URL_ATTR]: 'git@github.com:user/repository.git',
|
777 | 751 | });
|
778 | 752 |
|
779 | 753 | renderComponent(emptyStore, searchParams, location);
|
780 | 754 |
|
781 | 755 | await jest.advanceTimersByTimeAsync(MIN_STEP_DURATION_MS);
|
782 |
| - await waitFor(() => expect(mockOnNextStep).not.toHaveBeenCalled); |
| 756 | + await waitFor(() => expect(mockOnNextStep).toHaveBeenCalled()); |
783 | 757 |
|
784 | 758 | expect(mockOpenOAuthPage).not.toHaveBeenCalled();
|
785 |
| - expect(mockOnError).toHaveBeenCalledWith(sshPrivateRepoAllertItem); |
| 759 | + expect(mockOnError).not.toHaveBeenCalled(); |
786 | 760 | });
|
787 | 761 |
|
788 |
| - it('should show warning on bitbucket-server SSH url', async () => { |
| 762 | + it('should use default devfile on bitbucket-server SSH url', async () => { |
789 | 763 | searchParams = new URLSearchParams({
|
790 | 764 | [FACTORY_URL_ATTR]: 'ssh://git@bitbucket-server.com/~user/repository.git',
|
791 | 765 | });
|
792 | 766 |
|
793 | 767 | renderComponent(emptyStore, searchParams, location);
|
794 | 768 |
|
795 | 769 | await jest.advanceTimersByTimeAsync(MIN_STEP_DURATION_MS);
|
796 |
| - await waitFor(() => expect(mockOnNextStep).not.toHaveBeenCalled); |
| 770 | + await waitFor(() => expect(mockOnNextStep).toHaveBeenCalled); |
797 | 771 |
|
798 | 772 | expect(mockOpenOAuthPage).not.toHaveBeenCalled();
|
799 |
| - expect(mockOnError).toHaveBeenCalledWith(sshPrivateRepoAllertItem); |
| 773 | + expect(mockOnError).not.toHaveBeenCalled(); |
800 | 774 | });
|
801 | 775 | });
|
802 | 776 | });
|
|
0 commit comments