-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing different problems of the view (#24)
* Fixing different problems of the view * fixing some minor things on the docker-compose.yaml
- Loading branch information
Showing
11 changed files
with
58 additions
and
44 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
54 changes: 28 additions & 26 deletions
54
view/src/contents/graphs/graph-with-rechart/enrich-graph.spec.ts
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 |
---|---|---|
@@ -1,32 +1,34 @@ | ||
import { Tag } from '../../../api/client/tag/types'; | ||
import { tagFactory } from '../../../utils/data-factory/tag.factory'; | ||
import {enrichGraph} from './enrich-graph' | ||
import { enrichGraph } from './enrich-graph'; | ||
|
||
describe('enrichGraph', () => { | ||
let tagsMap: Map<number, Tag>; | ||
const tagId = (tag: number) => ({ tag }); | ||
|
||
describe('enrichGraph', ()=>{ | ||
let tagsMap : Map<number, Tag> | ||
const tagId=(tag: number)=>({tag}) | ||
|
||
beforeEach(()=>{ | ||
beforeEach(() => { | ||
const tagsList = [ | ||
tagFactory.build({id: 1, name: 'tag1'}), | ||
tagFactory.build({id: 2, name: 'tag2'}), | ||
tagFactory.build({id: 3, name: 'tag3'}), | ||
tagFactory.build({id: 4, name: 'tag4'}) | ||
] | ||
tagsMap = new Map(tagsList.map(tag => [tag.id, tag])) | ||
}) | ||
it('A graph with group type tags and preserving the order', ()=>{ | ||
const result = enrichGraph({ | ||
dateRange: 'all', | ||
group: { | ||
groupTags: [tagId(3), tagId(1)], | ||
group: 'tags', | ||
tagFactory.build({ id: 1, name: 'tag1' }), | ||
tagFactory.build({ id: 2, name: 'tag2' }), | ||
tagFactory.build({ id: 3, name: 'tag3' }), | ||
tagFactory.build({ id: 4, name: 'tag4' }), | ||
]; | ||
tagsMap = new Map(tagsList.map(tag => [tag.id, tag])); | ||
}); | ||
it('A graph with group type tags and preserving the order', () => { | ||
const result = enrichGraph( | ||
{ | ||
dateRange: 'all', | ||
group: { | ||
groupTags: [tagId(3), tagId(1)], | ||
group: 'tags', | ||
}, | ||
id: 1, | ||
kind: 'pie', | ||
name: 'some graph', | ||
}, | ||
id: 1, | ||
kind: 'pie', | ||
name: 'some graph' | ||
}, tagsMap) | ||
expect(result.group.groupTags).toEqual([tagsMap.get(3), tagsMap.get(1)]) | ||
}) | ||
}) | ||
tagsMap, | ||
); | ||
expect(result.group.groupTags).toEqual([tagsMap.get(3), tagsMap.get(1)]); | ||
}); | ||
}); |
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
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
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
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
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