Skip to content

Commit 4d28930

Browse files
update test
1 parent 2505cb8 commit 4d28930

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

ui/src/services/k8s/Metalk8sLocalVolumeProvider.test.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ describe('Metalk8sLocalVolumeProvider', () => {
233233
expect(result).toBe(false);
234234
});
235235

236-
it('should return true if the volume is provisioned', async () => {
236+
it('should return volume if the volume is provisioned', async () => {
237237
//S
238238
(
239239
mockCustomObjectsApi.getClusterCustomObject as jest.Mock
240240
).mockResolvedValue({
241-
status: { conditions: [{ type: 'Ready', status: 'True' }] },
241+
body: { status: { conditions: [{ type: 'Ready', status: 'True' }] } },
242242
});
243243
(mockCoreV1Api.readPersistentVolume as jest.Mock).mockResolvedValue({
244244
status: { phase: 'Bound' },
@@ -265,14 +265,16 @@ describe('Metalk8sLocalVolumeProvider', () => {
265265
(
266266
mockCustomObjectsApi.getClusterCustomObject as jest.Mock
267267
).mockResolvedValue({
268-
status: {
269-
conditions: [
270-
{
271-
type: 'Ready',
272-
status: 'False',
273-
reason: 'Volume is not provisioned',
274-
},
275-
],
268+
body: {
269+
status: {
270+
conditions: [
271+
{
272+
type: 'Ready',
273+
status: 'False',
274+
reason: 'Volume is not provisioned',
275+
},
276+
],
277+
},
276278
},
277279
});
278280
//E+V
@@ -342,6 +344,11 @@ describe('Metalk8sLocalVolumeProvider', () => {
342344
nodeName: 'test-node',
343345
rawBlockDevice: { devicePath: '/dev/sda' },
344346
storageClassName: 'ssd-ext4',
347+
template: {
348+
metadata: {
349+
labels: { 'xcore.scality.com/volume-type': 'data' },
350+
},
351+
},
345352
},
346353
},
347354
);

0 commit comments

Comments
 (0)