Added signatures for explore page too
Signed-off-by: Amelia-Maria Breda <ambreda@cisco.com>
This commit is contained in:
parent
5f494adb5a
commit
d4f4cea810
@ -30,6 +30,7 @@ const mockImageList = {
|
||||
NewestImage: {
|
||||
Tag: 'latest',
|
||||
Description: 'w',
|
||||
IsSigned: true,
|
||||
Licenses: '',
|
||||
Vendor: '',
|
||||
Labels: ''
|
||||
@ -42,6 +43,7 @@ const mockImageList = {
|
||||
NewestImage: {
|
||||
Tag: 'latest',
|
||||
Description: '',
|
||||
IsSigned: false,
|
||||
Licenses: '',
|
||||
Vendor: '',
|
||||
Labels: ''
|
||||
@ -54,6 +56,7 @@ const mockImageList = {
|
||||
NewestImage: {
|
||||
Tag: 'latest',
|
||||
Description: '',
|
||||
IsSigned: false,
|
||||
Licenses: '',
|
||||
Vendor: '',
|
||||
Labels: ''
|
||||
@ -84,6 +87,14 @@ describe('Explore component', () => {
|
||||
expect(await screen.findByText(/Looks like/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders signature chips', async () => {
|
||||
// @ts-ignore
|
||||
jest.spyOn(api, 'get').mockResolvedValue({ status: 200, data: { data: mockImageList } });
|
||||
render(<StateExploreWrapper />);
|
||||
expect(await screen.findAllByTestId('unverified-chip')).toHaveLength(2);
|
||||
expect(await screen.findAllByTestId('verified-chip')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("should log an error when data can't be fetched", async () => {
|
||||
// @ts-ignore
|
||||
jest.spyOn(api, 'get').mockRejectedValue({ status: 500, data: {} });
|
||||
|
@ -85,7 +85,7 @@ const endpoints = {
|
||||
if (filter.HasToBeSigned) filterParam += ` HasToBeSigned: ${filter.HasToBeSigned}`;
|
||||
filterParam += '}';
|
||||
if (Object.keys(filter).length === 0) filterParam = '';
|
||||
return `/v2/_zot/ext/search?query={GlobalSearch(${searchParam}, ${paginationParam} ${filterParam}) {Repos {Name LastUpdated Size Platforms { Os Arch } NewestImage { Tag Description Licenses Vendor Labels } DownloadCount}}}`;
|
||||
return `/v2/_zot/ext/search?query={GlobalSearch(${searchParam}, ${paginationParam} ${filterParam}) {Repos {Name LastUpdated Size Platforms { Os Arch } NewestImage { Tag Description IsSigned Licenses Vendor Labels } DownloadCount}}}`;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -108,6 +108,7 @@ function Explore() {
|
||||
name={item.name}
|
||||
version={item.latestVersion}
|
||||
description={item.description}
|
||||
isSigned={item.isSigned}
|
||||
tags={item.tags}
|
||||
vendor={item.vendor}
|
||||
platforms={item.platforms}
|
||||
|
Loading…
Reference in New Issue
Block a user