Skip to content

Commit 70e47bd

Browse files
committed
chore: Add mock for metadata folder name
1 parent bee412f commit 70e47bd

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
const mockAncestorFolder = {
2+
type: 'folder',
3+
id: '313259567207',
4+
etag: '1',
5+
name: 'Test Folder',
6+
size: 1024000,
7+
parent: {
8+
type: 'folder',
9+
id: '0',
10+
sequence_id: null,
11+
etag: null,
12+
name: 'All Files',
13+
},
14+
permissions: {
15+
can_download: true,
16+
can_upload: true,
17+
can_rename: true,
18+
can_delete: true,
19+
can_share: true,
20+
can_invite_collaborator: true,
21+
can_set_share_access: true,
22+
},
23+
path_collection: {
24+
total_count: 1,
25+
entries: [
26+
{
27+
type: 'folder',
28+
id: '0',
29+
sequence_id: null,
30+
etag: null,
31+
name: 'All Files',
32+
},
33+
],
34+
},
35+
modified_at: '2024-01-01T00:00:00-08:00',
36+
created_at: '2024-01-01T00:00:00-08:00',
37+
modified_by: {
38+
type: 'user',
39+
id: '123456789',
40+
name: 'Test User',
41+
login: 'test@example.com',
42+
},
43+
created_by: {
44+
type: 'user',
45+
id: '123456789',
46+
name: 'Test User',
47+
login: 'test@example.com',
48+
},
49+
has_collaborations: false,
50+
is_externally_owned: false,
51+
shared_link: null,
52+
watermark_info: {
53+
is_watermarked: false,
54+
},
55+
};
56+
57+
export default mockAncestorFolder;

src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { http, HttpResponse } from 'msw';
33
import type { Meta, StoryObj } from '@storybook/react';
44
import ContentExplorer from '../../ContentExplorer';
55
import { DEFAULT_HOSTNAME_API } from '../../../../constants';
6+
import mockAncestorFolder from '../../../common/__mocks__/mockAncestorFolder';
67
import { mockMetadata, mockSchema } from '../../../common/__mocks__/mockMetadata';
78

89
const EID = '0';
@@ -95,6 +96,9 @@ const meta: Meta<typeof ContentExplorer> = {
9596
http.get(`${DEFAULT_HOSTNAME_API}/2.0/metadata_templates/enterprise/templateName/schema`, () => {
9697
return HttpResponse.json(mockSchema);
9798
}),
99+
http.get(`${DEFAULT_HOSTNAME_API}/2.0/folders/313259567207`, () => {
100+
return HttpResponse.json(mockAncestorFolder);
101+
}),
98102
],
99103
},
100104
},

0 commit comments

Comments
 (0)