@patternfly/quickstarts 6.5.0-prerelease.3 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/quickstarts",
3
- "version": "6.5.0-prerelease.3",
3
+ "version": "6.5.0",
4
4
  "description": "PatternFly quick starts",
5
5
  "files": [
6
6
  "src",
@@ -51,7 +51,7 @@
51
51
  "react-dom": "^17 || ^18 || ^19"
52
52
  },
53
53
  "dependencies": {
54
- "dompurify": "^3.2.4",
54
+ "dompurify": "^3.3.2",
55
55
  "history": "^5.0.0"
56
56
  },
57
57
  "devDependencies": {
@@ -66,10 +66,9 @@
66
66
  "@rollup/plugin-commonjs": "^17.0.0",
67
67
  "@rollup/plugin-json": "^4.1.0",
68
68
  "@rollup/plugin-node-resolve": "^11.1.0",
69
+ "@testing-library/jest-dom": "^6.9.1",
69
70
  "@testing-library/react": "^13.4.0",
70
71
  "@types/dompurify": "^3.0.5",
71
- "@types/enzyme": "^3.10.7",
72
- "@types/enzyme-adapter-react-16": "^1.0.6",
73
72
  "@types/history": "^4.7.8",
74
73
  "@types/node": "^14.14.35",
75
74
  "@types/react": "^18.2.79",
@@ -77,9 +76,6 @@
77
76
  "clean-css-cli": "^4.3.0",
78
77
  "concat-files": "^0.1.1",
79
78
  "dart-sass": "^1.25.0",
80
- "enzyme": "^3.7.0",
81
- "enzyme-adapter-react-16": "^1.15.5",
82
- "enzyme-to-json": "^3.6.1",
83
79
  "monaco-editor": "0.34.1",
84
80
  "node-sass-glob-importer": "^5.3.2",
85
81
  "prettier": "^2.8.8",
@@ -1,24 +1,38 @@
1
- import { shallow } from 'enzyme';
2
- import MarkdownCopyClipboard, { CopyClipboard } from '../MarkdownCopyClipboard';
1
+ import { render } from '@testing-library/react';
2
+ import {
3
+ QuickStartContext,
4
+ QuickStartContextDefaults,
5
+ } from '@quickstarts/utils/quick-start-context';
6
+ import MarkdownCopyClipboard from '../MarkdownCopyClipboard';
7
+ import { MARKDOWN_COPY_BUTTON_ID } from '../const';
3
8
  import { htmlDocumentForCopyClipboard } from './test-data';
4
9
 
10
+ const contextValues = {
11
+ ...QuickStartContextDefaults,
12
+ getResource: (key: string) => key,
13
+ };
14
+
5
15
  describe('MarkdownCopyClipboard', () => {
6
16
  beforeAll(() => {
7
17
  document.body.innerHTML = htmlDocumentForCopyClipboard;
8
18
  });
19
+
9
20
  it('should render null if no element is found', () => {
10
- const wrapper = shallow(
11
- <MarkdownCopyClipboard docContext={document} rootSelector="#copy-markdown-3" />,
21
+ const { container } = render(
22
+ <QuickStartContext.Provider value={contextValues}>
23
+ <MarkdownCopyClipboard docContext={document} rootSelector="#copy-markdown-3" />
24
+ </QuickStartContext.Provider>,
12
25
  );
13
- expect(wrapper.isEmptyRender()).toBe(true);
14
- expect(wrapper.find(CopyClipboard).exists()).toBe(false);
26
+ expect(container.firstChild).toBeNull();
15
27
  });
16
28
 
17
- it('should render null if no element is found', () => {
18
- const wrapper = shallow(
19
- <MarkdownCopyClipboard docContext={document} rootSelector="#copy-markdown-1" />,
29
+ it('should render copy targets when rootSelector matches buttons in the document', () => {
30
+ render(
31
+ <QuickStartContext.Provider value={contextValues}>
32
+ <MarkdownCopyClipboard docContext={document} rootSelector="#copy-markdown-1" />
33
+ </QuickStartContext.Provider>,
20
34
  );
21
- expect(wrapper.isEmptyRender()).toBe(false);
22
- expect(wrapper.find(CopyClipboard).exists()).toBe(true);
35
+ const elements = document.querySelectorAll(`#copy-markdown-1 [${MARKDOWN_COPY_BUTTON_ID}]`);
36
+ expect(elements).toHaveLength(2);
23
37
  });
24
38
  });
@@ -132,18 +132,14 @@ const QuickStartTile: FC<QuickStartTileProps> = ({
132
132
  />
133
133
  ) : undefined;
134
134
 
135
+ const cardClasses = `pfext-catalog-item${isActive ? ' pf-m-current' : ''}`;
136
+
135
137
  return (
136
138
  <Card
137
139
  id={`${id}-catalog-tile`}
138
140
  style={{ height: '100%' }}
139
141
  data-testid={`qs-card-${camelize(displayName)}`}
140
- className="pfext-catalog-item"
141
- {...(isActive && {
142
- isClickable: true,
143
- isSelectable: true,
144
- isSelected: true,
145
- isClicked: true,
146
- })}
142
+ className={cardClasses}
147
143
  >
148
144
  <CardHeader
149
145
  {...(action && {
@@ -1,34 +1,39 @@
1
- import { Gallery, Card } from '@patternfly/react-core';
2
- import { shallow } from 'enzyme';
3
- import { EmptyBox } from '@console/internal/components/utils';
1
+ import { render, screen, waitFor } from '@testing-library/react';
4
2
  import { getQuickStarts } from '../../data/test-utils';
5
- import { QuickStartCatalogPage } from '../../QuickStartCatalogPage';
3
+ import { QuickStartContext, QuickStartContextDefaults } from '../../utils/quick-start-context';
6
4
  import QuickStartCatalog from '../QuickStartCatalog';
7
5
 
8
- jest.mock('@console/shared', () => {
9
- const ActualShared = require.requireActual('@console/shared');
10
- return {
11
- ...ActualShared,
12
- useQueryParams: () => new Map(),
13
- };
14
- });
6
+ const contextValues = {
7
+ ...QuickStartContextDefaults,
8
+ activeQuickStartID: '',
9
+ allQuickStartStates: {},
10
+ getResource: (key: string) => key,
11
+ };
12
+
13
+ const renderWithContext = (props: any) =>
14
+ render(
15
+ <QuickStartContext.Provider value={contextValues}>
16
+ <QuickStartCatalog {...props} />
17
+ </QuickStartContext.Provider>,
18
+ );
15
19
 
16
20
  describe('QuickStartCatalog', () => {
17
- it('should load an emptybox if no QS exist', () => {
18
- const QuickStartCatalogProps = { quickStarts: [], onClick: jest.fn() };
19
- const QuickStartCatalogWrapper = shallow(<QuickStartCatalogPage {...QuickStartCatalogProps} />);
20
- expect(QuickStartCatalogWrapper.find(EmptyBox).exists()).toBeTruthy();
21
+ it('should render an empty state if no QS exist', () => {
22
+ renderWithContext({ quickStarts: [] });
23
+ // When no quickstarts, the catalog renders no cards
24
+ expect(screen.queryByRole('article')).not.toBeInTheDocument();
21
25
  });
22
- it('should load a gallery if QS exist', () => {
23
- const QuickStartCatalogProps = { quickStarts: getQuickStarts(), onClick: jest.fn() };
24
- const QuickStartCatalogWrapper = shallow(<QuickStartCatalog {...QuickStartCatalogProps} />);
25
- expect(QuickStartCatalogWrapper.find(Gallery).exists()).toBeTruthy();
26
- });
27
- xit('should load galleryItems equal to the number of QS', () => {
28
- const QuickStartCatalogProps = { quickStarts: getQuickStarts(), onClick: jest.fn() };
29
- const QuickStartCatalogWrapper = shallow(<QuickStartCatalog {...QuickStartCatalogProps} />);
30
- const galleryItems = QuickStartCatalogWrapper.find(Card);
31
- expect(galleryItems.exists()).toBeTruthy();
32
- expect(galleryItems.length).toEqual(getQuickStarts().length);
26
+
27
+ it('should load a gallery if QS exist', async () => {
28
+ const quickStarts = getQuickStarts();
29
+ renderWithContext({ quickStarts });
30
+ // Each tile exposes the quick start display name as the title control (link-styled button)
31
+ await waitFor(() => {
32
+ quickStarts.forEach((qs) => {
33
+ expect(
34
+ screen.getByRole('button', { name: qs.spec.displayName }),
35
+ ).toBeInTheDocument();
36
+ });
37
+ });
33
38
  });
34
39
  });
@@ -1,36 +1,56 @@
1
- import { Card } from '@patternfly/react-core';
2
- import { shallow } from 'enzyme';
1
+ import { render, screen, waitFor } from '@testing-library/react';
3
2
  import { getQuickStarts } from '../../data/test-utils';
4
3
  import { QuickStartStatus } from '../../utils/quick-start-types';
4
+ import { QuickStartContext, QuickStartContextDefaults } from '../../utils/quick-start-context';
5
5
  import QuickStartTile from '../QuickStartTile';
6
6
 
7
- describe('QuickStartTile', () => {
8
- const quickstarts = getQuickStarts();
7
+ const contextValues = {
8
+ ...QuickStartContextDefaults,
9
+ activeQuickStartID: '',
10
+ setActiveQuickStart: jest.fn(),
11
+ getResource: (key: string) => key,
12
+ };
13
+
14
+ const quickstarts = getQuickStarts();
9
15
 
10
- it('should load proper catalog tile without featured property', () => {
11
- const wrapper = shallow(
12
- <QuickStartTile
13
- quickStart={quickstarts[0]}
14
- status={QuickStartStatus.NOT_STARTED}
15
- onClick={jest.fn()}
16
- isActive={false}
17
- />,
18
- );
19
- const catalogTile = wrapper.find(Card);
20
- expect(catalogTile.exists()).toBeTruthy();
16
+ const renderWithContext = (props: any) =>
17
+ render(
18
+ <QuickStartContext.Provider value={contextValues}>
19
+ <QuickStartTile {...props} />
20
+ </QuickStartContext.Provider>,
21
+ );
22
+
23
+ describe('QuickStartTile', () => {
24
+ it('should load proper catalog tile without featured property', async () => {
25
+ const quickStart = quickstarts[0];
26
+ renderWithContext({
27
+ quickStart,
28
+ status: QuickStartStatus.NOT_STARTED,
29
+ onClick: jest.fn(),
30
+ isActive: false,
31
+ });
32
+ await waitFor(() => {
33
+ expect(
34
+ screen.getByRole('button', { name: quickStart.spec.displayName }),
35
+ ).toBeInTheDocument();
36
+ });
37
+ // Status label is omitted for not-started tiles
38
+ expect(screen.queryByText('In progress')).not.toBeInTheDocument();
21
39
  });
22
40
 
23
- it('should load proper catalog tile with featured property', () => {
24
- const wrapper = shallow(
25
- <QuickStartTile
26
- quickStart={quickstarts[1]}
27
- status={QuickStartStatus.IN_PROGRESS}
28
- onClick={jest.fn()}
29
- isActive
30
- />,
31
- );
32
- const catalogTile = wrapper.find(Card);
33
- expect(catalogTile.exists()).toBeTruthy();
34
- expect(catalogTile.prop('isSelected')).toBe(true);
41
+ it('should load proper catalog tile with featured property', async () => {
42
+ const quickStart = quickstarts[1];
43
+ renderWithContext({
44
+ quickStart,
45
+ status: QuickStartStatus.IN_PROGRESS,
46
+ onClick: jest.fn(),
47
+ isActive: true,
48
+ });
49
+ await waitFor(() => {
50
+ expect(
51
+ screen.getByRole('button', { name: quickStart.spec.displayName }),
52
+ ).toBeInTheDocument();
53
+ });
54
+ expect(screen.getByText('In progress')).toBeInTheDocument();
35
55
  });
36
56
  });
@@ -1,43 +1,44 @@
1
- import { Popover } from '@patternfly/react-core';
2
- import { shallow } from 'enzyme';
1
+ import { render, screen, waitFor } from '@testing-library/react';
3
2
  import { getQuickStarts } from '../../data/test-utils';
3
+ import { QuickStartContext, QuickStartContextDefaults } from '../../utils/quick-start-context';
4
4
  import QuickStartTileDescription from '../QuickStartTileDescription';
5
5
 
6
- jest.mock('react', () => {
7
- const ActualReact = require.requireActual('react');
8
- return {
9
- ...ActualReact,
10
- useContext: () => jest.fn(),
11
- };
12
- });
6
+ const contextValues = {
7
+ ...QuickStartContextDefaults,
8
+ activeQuickStartID: '',
9
+ startQuickStart: jest.fn(),
10
+ restartQuickStart: jest.fn(),
11
+ getResource: (key: string) => key,
12
+ };
13
13
 
14
- xdescribe('QuickStartCatalog', () => {
15
- beforeEach(() => {
16
- spyOn(React, 'useContext').and.returnValue({
17
- activeQuickStartID: '',
18
- startQuickStart: () => {},
19
- restartQuickStart: () => {},
20
- getResource: (key) => `quickstart~${key}`,
21
- });
22
- });
14
+ const renderWithContext = (props: any) =>
15
+ render(
16
+ <QuickStartContext.Provider value={contextValues}>
17
+ <QuickStartTileDescription {...props} />
18
+ </QuickStartContext.Provider>,
19
+ );
23
20
 
24
- it('should show prerequisites only if provided', () => {
25
- // this quick start does not have prereqs
21
+ describe('QuickStartTileDescription', () => {
22
+ it('should show prerequisites only if provided', async () => {
26
23
  const quickStart = getQuickStarts()[0].spec;
27
- const QuickStartTileDescriptionWrapper = shallow(
28
- <QuickStartTileDescription description={quickStart.description} />,
29
- );
30
- expect(QuickStartTileDescriptionWrapper.find(Text)).toHaveLength(0);
24
+ renderWithContext({ description: quickStart.description });
25
+ await waitFor(() => {
26
+ expect(
27
+ screen.queryByRole('button', { name: 'Show prerequisites' }),
28
+ ).not.toBeInTheDocument();
29
+ });
31
30
  });
32
31
 
33
- it('shoould render prerequisites inside a popover', () => {
32
+ it('should render prerequisites trigger when prerequisite list is non-empty', async () => {
34
33
  const quickStart = getQuickStarts()[2].spec;
35
- const QuickStartTileDescriptionWrapper = shallow(
36
- <QuickStartTileDescription
37
- description={quickStart.description}
38
- prerequisites={quickStart.prerequisites}
39
- />,
40
- );
41
- expect(QuickStartTileDescriptionWrapper.find(Popover)).toHaveLength(1);
34
+ renderWithContext({
35
+ description: quickStart.description,
36
+ prerequisites: quickStart.prerequisites,
37
+ });
38
+ await waitFor(() => {
39
+ expect(
40
+ screen.getByRole('button', { name: 'Show prerequisites' }),
41
+ ).toBeInTheDocument();
42
+ });
42
43
  });
43
44
  });
@@ -1,25 +1,19 @@
1
- import { ComponentProps } from 'react';
2
- import { Button } from '@patternfly/react-core';
3
- import { ShallowWrapper, shallow } from 'enzyme';
1
+ import { render, waitFor } from '@testing-library/react';
4
2
  import { allQuickStarts } from '../../data/quick-start-test-data';
5
- import QuickStartMarkdownView from '../../QuickStartMarkdownView';
6
3
  import { QuickStartTaskStatus } from '../../utils/quick-start-types';
4
+ import { QuickStartContext, QuickStartContextDefaults } from '../../utils/quick-start-context';
7
5
  import { getQuickStartByName } from '../../utils/quick-start-utils';
8
6
  import QuickStartConclusion from '../QuickStartConclusion';
9
7
 
10
- jest.mock('react', () => {
11
- const ActualReact = require.requireActual('react');
12
- return {
13
- ...ActualReact,
14
- useContext: () => jest.fn(),
15
- };
16
- });
17
-
18
- const i18nNS = 'quickstart';
8
+ const contextValues = {
9
+ ...QuickStartContextDefaults,
10
+ activeQuickStartID: '',
11
+ startQuickStart: jest.fn(),
12
+ restartQuickStart: jest.fn(),
13
+ getResource: (key: string) => key,
14
+ };
19
15
 
20
- type QuickStartConclusionProps = ComponentProps<typeof QuickStartConclusion>;
21
- let wrapper: ShallowWrapper<QuickStartConclusionProps>;
22
- const props: QuickStartConclusionProps = {
16
+ const defaultProps = {
23
17
  tasks: getQuickStartByName('explore-pipelines', allQuickStarts).spec.tasks,
24
18
  allTaskStatuses: [
25
19
  QuickStartTaskStatus.SUCCESS,
@@ -31,52 +25,56 @@ const props: QuickStartConclusionProps = {
31
25
  onQuickStartChange: jest.fn(),
32
26
  };
33
27
 
34
- xdescribe('QuickStartConclusion', () => {
28
+ const renderWithContext = (props = {}) =>
29
+ render(
30
+ <QuickStartContext.Provider value={contextValues}>
31
+ <QuickStartConclusion {...defaultProps} {...props} />
32
+ </QuickStartContext.Provider>,
33
+ );
34
+
35
+ describe('QuickStartConclusion', () => {
35
36
  beforeEach(() => {
36
- spyOn(React, 'useContext').and.returnValue({
37
- activeQuickStartID: '',
38
- startQuickStart: () => {},
39
- restartQuickStart: () => {},
40
- getResource: (key) => `quickstart~${key}`,
41
- });
42
- wrapper = shallow(<QuickStartConclusion {...props} />);
37
+ jest.clearAllMocks();
43
38
  });
44
39
 
45
- it('should render conclusion if there are no failed tasks', () => {
46
- expect(wrapper.find(QuickStartMarkdownView).first().props().content).toEqual('conclusion');
40
+ it('should render conclusion if there are no failed tasks', async () => {
41
+ renderWithContext();
42
+ await waitFor(() => {
43
+ expect(document.body.textContent).toMatch(/conclusion/);
44
+ });
47
45
  });
48
46
 
49
- it('should render link for next quick start if nextQuickStart prop is available and there are no failed tasks', () => {
50
- wrapper = shallow(
51
- <QuickStartConclusion
52
- {...props}
53
- nextQuickStarts={[getQuickStartByName('explore-pipelines', allQuickStarts)]}
54
- />,
55
- );
56
- expect(wrapper.find(Button).at(0).props().children).toEqual(
57
- `${i18nNS}~Start Installing the Pipelines Operator quick start`,
58
- );
47
+ it('should render link for next quick start if nextQuickStart prop is available and there are no failed tasks', async () => {
48
+ renderWithContext({
49
+ nextQuickStarts: [getQuickStartByName('explore-pipelines', allQuickStarts)],
50
+ });
51
+ await waitFor(() => {
52
+ expect(document.body.textContent).toMatch(
53
+ /Start Installing the Pipelines Operator quick start/,
54
+ );
55
+ });
59
56
  });
60
57
 
61
- it('should not render link for next quick start if nextQuickStart props is not available', () => {
62
- expect(wrapper.find(Button).length).toBe(0);
58
+ it('should not render link for next quick start if nextQuickStart props is not available', async () => {
59
+ renderWithContext();
60
+ await waitFor(() => {
61
+ expect(document.body.textContent).toMatch(/conclusion/);
62
+ });
63
+ expect(document.body.textContent).not.toMatch(/Start .* quick start/);
63
64
  });
64
65
 
65
- it('should not render conclusion, link for next quick start and should render message for retrying if there are failed tasks', () => {
66
- wrapper = shallow(
67
- <QuickStartConclusion
68
- {...props}
69
- nextQuickStarts={[getQuickStartByName('explore-pipelines', allQuickStarts)]}
70
- allTaskStatuses={[
71
- QuickStartTaskStatus.FAILED,
72
- QuickStartTaskStatus.SUCCESS,
73
- QuickStartTaskStatus.SUCCESS,
74
- ]}
75
- />,
76
- );
77
- expect(wrapper.find(QuickStartMarkdownView).first().props().content).toEqual(
78
- `${i18nNS}~One or more verifications did not pass during this quick start. Revisit the tasks or the help links, and then try again.`,
79
- );
80
- expect(wrapper.find(Button).length).toBe(0);
66
+ it('should not render conclusion and should render message for retrying if there are failed tasks', async () => {
67
+ renderWithContext({
68
+ nextQuickStarts: [getQuickStartByName('explore-pipelines', allQuickStarts)],
69
+ allTaskStatuses: [
70
+ QuickStartTaskStatus.FAILED,
71
+ QuickStartTaskStatus.SUCCESS,
72
+ QuickStartTaskStatus.SUCCESS,
73
+ ],
74
+ });
75
+ await waitFor(() => {
76
+ expect(document.body.textContent).toMatch(/One or more verifications did not pass/);
77
+ });
78
+ expect(document.body.textContent).not.toMatch(/Start .* quick start/);
81
79
  });
82
80
  });
@@ -1,52 +1,71 @@
1
- import { ComponentProps } from 'react';
2
- import { ShallowWrapper, shallow } from 'enzyme';
1
+ import { render, waitFor } from '@testing-library/react';
3
2
  import { allQuickStarts } from '../../data/quick-start-test-data';
4
3
  import { QuickStartTaskStatus } from '../../utils/quick-start-types';
4
+ import { QuickStartContext, QuickStartContextDefaults } from '../../utils/quick-start-context';
5
5
  import { getQuickStartByName } from '../../utils/quick-start-utils';
6
- import QuickStartConclusion from '../QuickStartConclusion';
7
6
  import QuickStartContent from '../QuickStartContent';
8
- import QuickStartIntroduction from '../QuickStartIntroduction';
9
- import QuickStartTasks from '../QuickStartTasks';
10
7
 
11
- type QuickStartContentProps = ComponentProps<typeof QuickStartContent>;
8
+ const contextValues = {
9
+ ...QuickStartContextDefaults,
10
+ getResource: (key: string) => key,
11
+ };
12
12
 
13
- let wrapper: ShallowWrapper<QuickStartContentProps>;
13
+ const quickStart = getQuickStartByName('explore-serverless', allQuickStarts);
14
+ const totalTasks = quickStart.spec.tasks.length;
14
15
 
15
- const props: QuickStartContentProps = {
16
- quickStart: getQuickStartByName('explore-serverless', allQuickStarts),
17
- allTaskStatuses: [
18
- QuickStartTaskStatus.INIT,
19
- QuickStartTaskStatus.INIT,
20
- QuickStartTaskStatus.INIT,
21
- ],
16
+ const defaultProps = {
17
+ quickStart,
18
+ allTaskStatuses: [QuickStartTaskStatus.INIT, QuickStartTaskStatus.INIT],
22
19
  taskNumber: -1,
23
20
  onTaskReview: jest.fn(),
24
21
  onTaskSelect: jest.fn(),
25
22
  onQuickStartChange: jest.fn(),
26
23
  };
27
24
 
25
+ const renderWithContext = (props = {}) =>
26
+ render(
27
+ <QuickStartContext.Provider value={contextValues}>
28
+ <QuickStartContent {...defaultProps} {...props} />
29
+ </QuickStartContext.Provider>,
30
+ );
31
+
28
32
  describe('QuickStartContent', () => {
29
33
  beforeEach(() => {
30
- wrapper = shallow(<QuickStartContent {...props} />);
34
+ jest.clearAllMocks();
31
35
  });
32
36
 
33
- it('should render QuickStartIntroduction when the tour status is Not Started', () => {
34
- expect(wrapper.find(QuickStartIntroduction).length).toBe(1);
35
- expect(wrapper.find(QuickStartTasks).length).toBe(0);
36
- expect(wrapper.find(QuickStartConclusion).length).toBe(0);
37
+ it('should render QuickStartIntroduction when the tour status is Not Started', async () => {
38
+ renderWithContext();
39
+ await waitFor(() => {
40
+ expect(document.body.textContent).toMatch(
41
+ new RegExp(`In this quick start, you will complete ${totalTasks} task`),
42
+ );
43
+ });
44
+ expect(document.body.textContent).not.toMatch(/Your Serverless Operator is ready/);
37
45
  });
38
46
 
39
- it('should render QuickStartTasks when the tour is In Progress', () => {
40
- wrapper = shallow(<QuickStartContent {...props} taskNumber={1} />);
41
- expect(wrapper.find(QuickStartIntroduction).length).toBe(0);
42
- expect(wrapper.find(QuickStartTasks).length).toBe(1);
43
- expect(wrapper.find(QuickStartConclusion).length).toBe(0);
47
+ it('should render QuickStartTasks when the tour is In Progress', async () => {
48
+ // taskNumber is 0-based index into spec.tasks; first task visible and active when non-INIT
49
+ renderWithContext({
50
+ taskNumber: 0,
51
+ allTaskStatuses: [QuickStartTaskStatus.VISITED, QuickStartTaskStatus.INIT],
52
+ });
53
+ await waitFor(() => {
54
+ expect(document.body.textContent).toMatch(/Install the OpenShift Serverless Operator/);
55
+ });
56
+ expect(document.body.textContent).not.toMatch(
57
+ new RegExp(`In this quick start, you will complete ${totalTasks} task`),
58
+ );
44
59
  });
45
60
 
46
- it('should render QuickStartConclusion when the tour is Complete', () => {
47
- wrapper = shallow(<QuickStartContent {...props} taskNumber={2} />);
48
- expect(wrapper.find(QuickStartIntroduction).length).toBe(0);
49
- expect(wrapper.find(QuickStartTasks).length).toBe(0);
50
- expect(wrapper.find(QuickStartConclusion).length).toBe(1);
61
+ it('should render QuickStartConclusion when the tour is Complete', async () => {
62
+ renderWithContext({ taskNumber: totalTasks });
63
+ await waitFor(() => {
64
+ expect(document.body.textContent).toMatch(/Your Serverless Operator is ready/);
65
+ });
66
+ // Conclusion still lists task headers; intro copy is not shown
67
+ expect(document.body.textContent).not.toMatch(
68
+ /In this quick start, you will complete \d+ task/,
69
+ );
51
70
  });
52
71
  });