Skip to content
Snippets Groups Projects
Commit a1e624db authored by Paul Slaughter's avatar Paul Slaughter :two:
Browse files

Merge branch...

Merge branch '370537-replace-finding-components-with-find-findall-in-spec-frontend-jobs' into 'master'

Replace finding components with find/findAll in spec/frontend/jobs

See merge request !95209
parents 7ad97472 32afe7b6
No related branches found
No related tags found
2 merge requests!96059Draft: Add GraphQL query for deployment details,!95209Replace finding components with find/findAll in spec/frontend/jobs
Pipeline #617480002 passed with warnings
Pipeline: GitLab

#617504925

    ......@@ -46,7 +46,7 @@ describe('Environments block', () => {
    });
    };
    const findText = () => wrapper.find(EnvironmentsBlock).text();
    const findText = () => wrapper.findComponent(EnvironmentsBlock).text();
    const findJobDeploymentLink = () => wrapper.find('[data-testid="job-deployment-link"]');
    const findEnvironmentLink = () => wrapper.find('[data-testid="job-environment-link"]');
    const findClusterLink = () => wrapper.find('[data-testid="job-cluster-link"]');
    ......
    ......@@ -10,7 +10,7 @@ describe('Erased block', () => {
    const timeago = getTimeago();
    const formattedDate = timeago.format(erasedAt);
    const findLink = () => wrapper.find(GlLink);
    const findLink = () => wrapper.findComponent(GlLink);
    const createComponent = (props) => {
    wrapper = mount(ErasedBlock, {
    ......
    ......@@ -57,18 +57,18 @@ describe('Job App', () => {
    await nextTick();
    };
    const findLoadingComponent = () => wrapper.find(GlLoadingIcon);
    const findSidebar = () => wrapper.find(Sidebar);
    const findLoadingComponent = () => wrapper.findComponent(GlLoadingIcon);
    const findSidebar = () => wrapper.findComponent(Sidebar);
    const findJobContent = () => wrapper.find('[data-testid="job-content"');
    const findStuckBlockComponent = () => wrapper.find(StuckBlock);
    const findStuckBlockComponent = () => wrapper.findComponent(StuckBlock);
    const findStuckBlockWithTags = () => wrapper.find('[data-testid="job-stuck-with-tags"');
    const findStuckBlockNoActiveRunners = () =>
    wrapper.find('[data-testid="job-stuck-no-active-runners"');
    const findFailedJobComponent = () => wrapper.find(UnmetPrerequisitesBlock);
    const findEnvironmentsBlockComponent = () => wrapper.find(EnvironmentsBlock);
    const findErasedBlock = () => wrapper.find(ErasedBlock);
    const findFailedJobComponent = () => wrapper.findComponent(UnmetPrerequisitesBlock);
    const findEnvironmentsBlockComponent = () => wrapper.findComponent(EnvironmentsBlock);
    const findErasedBlock = () => wrapper.findComponent(ErasedBlock);
    const findArchivedJob = () => wrapper.find('[data-testid="archived-job"]');
    const findEmptyState = () => wrapper.find(EmptyState);
    const findEmptyState = () => wrapper.findComponent(EmptyState);
    const findJobNewIssueLink = () => wrapper.find('[data-testid="job-new-issue"]');
    const findJobEmptyStateTitle = () => wrapper.find('[data-testid="job-empty-state-title"]');
    const findJobLogScrollTop = () => wrapper.find('[data-testid="job-controller-scroll-top"]');
    ......
    ......@@ -10,8 +10,8 @@ describe('Job Retry Forward Deployment Modal', () => {
    let wrapper;
    const retryOutdatedJobDocsUrl = 'url-to-docs';
    const findLink = () => wrapper.find(GlLink);
    const findModal = () => wrapper.find(GlModal);
    const findLink = () => wrapper.findComponent(GlLink);
    const findModal = () => wrapper.findComponent(GlModal);
    const createWrapper = ({ props = {}, provide = {}, stubs = {} } = {}) => {
    store = createStore();
    ......
    ......@@ -11,7 +11,7 @@ describe('Job Sidebar Details Container', () => {
    const findJobTimeout = () => wrapper.findByTestId('job-timeout');
    const findJobTags = () => wrapper.findByTestId('job-tags');
    const findAllDetailsRow = () => wrapper.findAll(DetailRow);
    const findAllDetailsRow = () => wrapper.findAllComponents(DetailRow);
    const createWrapper = ({ props = {} } = {}) => {
    store = createStore();
    ......
    ......@@ -39,7 +39,7 @@ describe('Job Log Header Line', () => {
    });
    it('renders the line number component', () => {
    expect(wrapper.find(LineNumber).exists()).toBe(true);
    expect(wrapper.findComponent(LineNumber).exists()).toBe(true);
    });
    it('renders a span the provided text', () => {
    ......@@ -90,7 +90,7 @@ describe('Job Log Header Line', () => {
    });
    it('renders the duration badge', () => {
    expect(wrapper.find(DurationBadge).exists()).toBe(true);
    expect(wrapper.findComponent(DurationBadge).exists()).toBe(true);
    });
    });
    });
    ......@@ -42,7 +42,7 @@ describe('Job Log Line', () => {
    });
    it('renders the line number component', () => {
    expect(wrapper.find(LineNumber).exists()).toBe(true);
    expect(wrapper.findComponent(LineNumber).exists()).toBe(true);
    });
    it('renders a span the provided text', () => {
    ......
    ......@@ -15,11 +15,11 @@ describe('Sidebar details block', () => {
    let wrapper;
    const forwardDeploymentFailure = 'forward_deployment_failure';
    const findModal = () => wrapper.find(JobRetryForwardDeploymentModal);
    const findModal = () => wrapper.findComponent(JobRetryForwardDeploymentModal);
    const findArtifactsBlock = () => wrapper.findComponent(ArtifactsBlock);
    const findCancelButton = () => wrapper.findByTestId('cancel-button');
    const findNewIssueButton = () => wrapper.findByTestId('job-new-issue');
    const findRetryButton = () => wrapper.find(JobRetryButton);
    const findRetryButton = () => wrapper.findComponent(JobRetryButton);
    const findTerminalLink = () => wrapper.findByTestId('terminal-link');
    const findEraseLink = () => wrapper.findByTestId('job-log-erase-link');
    ......@@ -176,7 +176,7 @@ describe('Sidebar details block', () => {
    describe('with stages', () => {
    it('renders value provided as selectedStage as selected', () => {
    expect(wrapper.find(StagesDropdown).props('selectedStage')).toBe('aStage');
    expect(wrapper.findComponent(StagesDropdown).props('selectedStage')).toBe('aStage');
    });
    });
    ......@@ -184,7 +184,7 @@ describe('Sidebar details block', () => {
    beforeEach(() => store.dispatch('receiveJobSuccess', job));
    it('does not render jobs container', () => {
    expect(wrapper.find(JobsContainer).exists()).toBe(false);
    expect(wrapper.findComponent(JobsContainer).exists()).toBe(false);
    });
    });
    ......@@ -195,7 +195,7 @@ describe('Sidebar details block', () => {
    });
    it('renders list of jobs', () => {
    expect(wrapper.find(JobsContainer).exists()).toBe(true);
    expect(wrapper.findComponent(JobsContainer).exists()).toBe(true);
    });
    });
    });
    ......
    ......@@ -26,8 +26,8 @@ describe('Stuck Block Job component', () => {
    wrapper.find('[data-testid="job-stuck-no-active-runners"]');
    const findStuckNoRunners = () => wrapper.find('[data-testid="job-stuck-no-runners"]');
    const findStuckWithTags = () => wrapper.find('[data-testid="job-stuck-with-tags"]');
    const findRunnerPathLink = () => wrapper.find(GlLink);
    const findAllBadges = () => wrapper.findAll(GlBadge);
    const findRunnerPathLink = () => wrapper.findComponent(GlLink);
    const findAllBadges = () => wrapper.findAllComponents(GlBadge);
    describe('with no runners for project', () => {
    beforeEach(() => {
    ......
    ......@@ -23,7 +23,7 @@ describe('Unmet Prerequisites Block Job component', () => {
    });
    it('renders an alert with the correct message', () => {
    const container = wrapper.find(GlAlert);
    const container = wrapper.findComponent(GlAlert);
    const alertMessage =
    'This job failed because the necessary resources were not successfully created.';
    ......@@ -32,7 +32,7 @@ describe('Unmet Prerequisites Block Job component', () => {
    });
    it('renders link to help page', () => {
    const helpLink = wrapper.find(GlLink);
    const helpLink = wrapper.findComponent(GlLink);
    expect(helpLink).not.toBeNull();
    expect(helpLink.text()).toContain('More information');
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment