mirror of https://github.com/artifacthub/hub.git
Fix tests
Signed-off-by: Cintia Sánchez García <cynthiasg@icloud.com>
This commit is contained in:
parent
d1254dd58a
commit
273cdb2a0d
|
|
@ -271,7 +271,7 @@ describe('Details', () => {
|
|||
</Router>
|
||||
);
|
||||
|
||||
expect(screen.getByText('Versions')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Versions')).toHaveLength(2);
|
||||
mockPackage.availableVersions!.forEach((vs: Version) => {
|
||||
expect(screen.getByText(vs.version)).toBeInTheDocument();
|
||||
});
|
||||
|
|
@ -322,7 +322,7 @@ describe('Details', () => {
|
|||
</Router>
|
||||
);
|
||||
|
||||
expect(screen.getByText('Versions')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Versions')).toHaveLength(2);
|
||||
expect(screen.getByText('1.0.0')).toBeInTheDocument();
|
||||
|
||||
expect(screen.getByText('Provider')).toBeInTheDocument();
|
||||
|
|
@ -380,7 +380,7 @@ describe('Details', () => {
|
|||
</Router>
|
||||
);
|
||||
|
||||
expect(screen.getByText('Versions')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Versions')).toHaveLength(2);
|
||||
expect(screen.getByText('Pipeline minimal version')).toBeInTheDocument();
|
||||
expect(screen.getByText('Keywords')).toBeInTheDocument();
|
||||
|
||||
|
|
@ -399,7 +399,7 @@ describe('Details', () => {
|
|||
</Router>
|
||||
);
|
||||
|
||||
expect(screen.getByText('Versions')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Versions')).toHaveLength(2);
|
||||
expect(screen.getByText('Pipeline minimal version')).toBeInTheDocument();
|
||||
expect(screen.getByText('Tasks')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Run After:')).toHaveLength(2);
|
||||
|
|
@ -419,7 +419,7 @@ describe('Details', () => {
|
|||
</Router>
|
||||
);
|
||||
|
||||
expect(screen.getByText('Versions')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Versions')).toHaveLength(2);
|
||||
expect(screen.getByText('Workflows version')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('argoVersion')).toBeInTheDocument();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ import Maintainers from './Maintainers';
|
|||
import Platforms from './Platforms';
|
||||
import SecurityReport from './securityReport';
|
||||
import TasksInPipeline from './TasksInPipeline';
|
||||
import VersionsModal from './VersionsModal';
|
||||
import VersionInRow from './VersionInRow';
|
||||
import Version from './Version';
|
||||
import VersionInRow from './VersionInRow';
|
||||
import VersionsModal from './VersionsModal';
|
||||
|
||||
interface Props {
|
||||
package: Package;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,9 @@ const VersionInRow = (props: Props) => {
|
|||
)}
|
||||
</div>
|
||||
</td>
|
||||
<td>{props.appVersion && <span>{props.appVersion}</span>}</td>
|
||||
<td>
|
||||
<span>{props.appVersion || '-'}</span>
|
||||
</td>
|
||||
<td className="text-nowrap">
|
||||
<span className="text-muted px-1">{formattedDate}</span>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -19,8 +19,14 @@ const VersionsModal = (props: Props) => {
|
|||
return (
|
||||
<>
|
||||
<div role="list">
|
||||
<div className="d-none d-md-block">{props.items.slice(0, 3)}</div>
|
||||
<div className="d-block d-md-none">{props.items.slice(0, 5)}</div>
|
||||
{props.items.length > 3 ? (
|
||||
<>
|
||||
<div className="d-none d-md-block">{props.items.slice(0, 3)}</div>
|
||||
<div className="d-block d-md-none">{props.items.slice(0, 5)}</div>
|
||||
</>
|
||||
) : (
|
||||
<div>{props.items}</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="d-none d-md-flex flex-row align-items-baseline">
|
||||
|
|
|
|||
|
|
@ -78,24 +78,139 @@ exports[`Details renders correctly 1`] = `
|
|||
<div
|
||||
role="list"
|
||||
>
|
||||
<div
|
||||
class="py-1 py-sm-0 w-100 text-truncate"
|
||||
role="listitem"
|
||||
<div>
|
||||
<div
|
||||
class="py-1 py-sm-0 w-100 text-truncate"
|
||||
role="listitem"
|
||||
>
|
||||
<div
|
||||
class="d-flex flex-row align-items-baseline"
|
||||
>
|
||||
<button
|
||||
aria-label="Open version 1.0.0"
|
||||
class="btn btn-link text-primary ps-0 pt-0 pb-0 border-0 text-truncate d-block mw-100 text-start version"
|
||||
>
|
||||
1.0.0
|
||||
</button>
|
||||
<small
|
||||
class="text-muted"
|
||||
>
|
||||
(1 Jan, 1970)
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="d-none d-md-flex flex-row align-items-baseline"
|
||||
>
|
||||
<button
|
||||
aria-label="See all entries"
|
||||
class="btn btn-link ps-0 pe-1 position-relative text-primary btn"
|
||||
>
|
||||
<div
|
||||
class="d-flex flex-row align-items-baseline"
|
||||
class="d-flex flex-row align-items-center"
|
||||
>
|
||||
<button
|
||||
aria-label="Open version 1.0.0"
|
||||
class="btn btn-link text-primary ps-0 pt-0 pb-0 border-0 text-truncate d-block mw-100 text-start version"
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="me-1"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
stroke="currentColor"
|
||||
stroke-width="0"
|
||||
viewBox="0 0 20 20"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
1.0.0
|
||||
</button>
|
||||
<small
|
||||
class="text-muted"
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z"
|
||||
fill-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
<span>
|
||||
See all
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
<div
|
||||
class="text-muted position-relative summary"
|
||||
>
|
||||
(1)
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
aria-modal="false"
|
||||
class="modal modal"
|
||||
role="dialog"
|
||||
>
|
||||
<div
|
||||
class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable modalDialog"
|
||||
>
|
||||
<div
|
||||
class="modal-content border border-3 mx-auto content modal"
|
||||
>
|
||||
(1 Jan, 1970)
|
||||
</small>
|
||||
<div
|
||||
class="modal-header d-flex flex-row align-items-center header undefined"
|
||||
>
|
||||
<div
|
||||
class="h3 m-2 flex-grow-1 text-truncate title"
|
||||
>
|
||||
Chart versions
|
||||
</div>
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="btn-close"
|
||||
type="button"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="modal-body p-4 h-100 d-flex flex-column"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="overflow-hidden alertWrapper"
|
||||
data-testid="alertWrapper"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="modal-footer p-3 modalFooter"
|
||||
>
|
||||
<button
|
||||
aria-label="Close modal"
|
||||
class="btn btn-sm btn-outline-secondary text-uppercase"
|
||||
type="button"
|
||||
>
|
||||
<div
|
||||
class="d-flex flex-row align-items-center"
|
||||
>
|
||||
<svg
|
||||
class="me-2"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
stroke="currentColor"
|
||||
stroke-width="0"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M0 0h24v24H0z"
|
||||
fill="none"
|
||||
/>
|
||||
<path
|
||||
d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
||||
/>
|
||||
</svg>
|
||||
<div>
|
||||
Close
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ exports[`VersionInRow creates snapshot 1`] = `
|
|||
</button>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span>
|
||||
-
|
||||
</span>
|
||||
</td>
|
||||
<td
|
||||
class="text-nowrap"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue