forked from geosolutions-it/geonode-mapstore-client
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#937: Pending copy exectutions are not updated correctly on page relo…
…ad (#936)
- Loading branch information
1 parent
4acf476
commit b989d57
Showing
3 changed files
with
111 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
geonode_mapstore_client/client/js/utils/__tests__/ResourceServiceUtils-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
|
||
/* | ||
* Copyright 2021, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import expect from 'expect'; | ||
import { | ||
ProcessTypes, | ||
extractExecutionsFromResources | ||
} from '../ResourceServiceUtils'; | ||
|
||
describe('Test Resource Service Utils', () => { | ||
it('should extract executions from resources', () => { | ||
const executions = extractExecutionsFromResources([ | ||
{ | ||
pk: 1, | ||
executions: [ | ||
{ | ||
status_url: 'status_url', | ||
user: 'admin', | ||
func_name: 'copy' | ||
}, | ||
{ | ||
status_url: 'status_url', | ||
user: 'user', | ||
func_name: 'copy' | ||
}, | ||
{ | ||
status_url: 'status_url', | ||
user: 'user' | ||
} | ||
] | ||
}, | ||
{ | ||
pk: 2, | ||
executions: [] | ||
} | ||
], 'admin'); | ||
expect(executions).toEqual([{ | ||
resource: { | ||
pk: 1, | ||
executions: [ | ||
{ | ||
status_url: 'status_url', | ||
user: 'admin', | ||
func_name: 'copy' | ||
}, | ||
{ | ||
status_url: 'status_url', | ||
user: 'user', | ||
func_name: 'copy' | ||
}, | ||
{ | ||
status_url: 'status_url', | ||
user: 'user' | ||
} | ||
] | ||
}, | ||
output: { | ||
status_url: 'status_url', | ||
user: 'admin', | ||
func_name: 'copy' | ||
}, | ||
processType: ProcessTypes.COPY_RESOURCE | ||
}]); | ||
}); | ||
}); |