mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-27 15:39:54 +03:00
feat(taglist): improve visibility of multi-architecture images (#271)
closes #271
This commit is contained in:
parent
affb0572c9
commit
4091baa341
4 changed files with 88 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
import { supportListManifest, filterWrongManifests } from '../src/scripts/docker-image.js';
|
||||
import { supportListManifest, filterWrongManifests, platformToString } from '../src/scripts/docker-image.js';
|
||||
import { dockerManifestList } from './fixtures/docker-manifest-list.js';
|
||||
import { ociImageIndexLayer } from './fixtures/oci-image-index-layer.js';
|
||||
import { ociImageIndexManifest } from './fixtures/oci-image-index-manifest.js';
|
||||
|
@ -36,10 +36,18 @@ describe('docker-image', () => {
|
|||
);
|
||||
});
|
||||
it('should return all manifests for `application/vnd.oci.image.index.v1+json`', () => {
|
||||
assert.equal(
|
||||
filterWrongManifests(ociImageIndexManifest['application/vnd.oci.image.index.v1+json']).length,
|
||||
2
|
||||
);
|
||||
assert.equal(filterWrongManifests(ociImageIndexManifest['application/vnd.oci.image.index.v1+json']).length, 2);
|
||||
});
|
||||
});
|
||||
describe('platformToString', () => {
|
||||
it('should return unknown when the platform is not found', () => {
|
||||
assert.equal(platformToString(), 'unknown');
|
||||
assert.equal(platformToString({}), 'unknown');
|
||||
});
|
||||
it('should format the platform', () => {
|
||||
assert.equal(platformToString({ os: 'linux', architecture: 'amd64' }), 'amd64');
|
||||
assert.equal(platformToString({ os: 'linux', architecture: 'arm', variant: 'v7' }), 'armv7');
|
||||
assert.equal(platformToString({ architecture: 'arm', variant: 'v7' }), 'armv7');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue