1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00
Sofia Calderon 7a22c9e85b
Refactoring apiConverts (#817)
* configured babel and jest to work with webpack

* added util function to camelize object entries

* added tests for apiconvert dashboard

* added enaming object key function

* finished refactoring of convertapi dashboard

* renamed camelize to transformObject

* renamed uuids to randomValues

* use random strings instead of hard coded values in test

* refactored dictionary.process and added tests

* refactored dashboard tests - test with json objects

* added first tests for apiConvert core

* made camelizeObjectkeys immutable

* added talismanrc to gitignore

* added all tests for apiConverts core

* added more dictionary tests

* finished refactoring apiConverts dictionary

* restructured objects in folders

* refactored apiConverts persistence

* refactored apiConvert pos

* refactored apiConvert privateAccess

* refactored apiConverts process

* refactored apiConverts report

* refactored apiConverts user

* refactored apiConverts values

* refactored apiConverts window

* linted all test files

* removed tests for privateAccess

* removed typos from prev implementation
2021-05-12 12:34:53 -04:00

43 lines
1.6 KiB
JavaScript

import {
convertListPrintFormats,
convertReportOutput,
convertDrillTables,
convertReportView
} from '@/utils/ADempiere/apiConverts/report'
import reportOutput from './objects/fromApi/reportOutput.json'
import convertedReportOutput from './objects/converted/reportOutput.json'
import printFormats from './objects/fromApi/printFormats.json'
import convertedPrintFormats from './objects/converted/printFormats.json'
import drillTables from './objects/fromApi/drillTables.json'
import convertedDrillTables from './objects/converted/drillTables.json'
import reportView from './objects/fromApi/reportView.json'
import convertedReportView from './objects/converted/reportView.json'
describe('reportOutput', () => {
it('should return a converted reportOutput object', () => {
const actualReportOutput = convertReportOutput(reportOutput)
expect(actualReportOutput).toEqual(convertedReportOutput)
})
})
describe('printFormats', () => {
it('should return a converted printFormats object', () => {
const actualPrintFormats = convertListPrintFormats(printFormats)
expect(actualPrintFormats).toEqual(convertedPrintFormats)
})
})
describe('drillTables', () => {
it('should return a converted drillTables object', () => {
const actualDrillTables = convertDrillTables(drillTables)
expect(actualDrillTables).toEqual(convertedDrillTables)
})
})
describe('reportView', () => {
it('should return a converted reportView object', () => {
const actualReportView = convertReportView(reportView)
expect(actualReportView).toEqual(convertedReportView)
})
})