Fakultas Ilmu Komputer UI

Commit 0b607fe8 authored by Nabilah Adani's avatar Nabilah Adani
Browse files

[RED] added new unit test in utils

parent 5b54f8de
......@@ -11,7 +11,8 @@ describe('<ExportPDFButton />', () => {
selectedKey={''}
dataType={''}
chartType={true}
information={''}
totalCount={''}
information={[0,1]}
clickable={false} />);
})
it('should call downloadAsPDF', () => {
......@@ -22,7 +23,8 @@ describe('<ExportPDFButton />', () => {
selectedKey={''}
dataType={''}
chartType={true}
information={''}
totalCount={''}
information={[0,1]}
clickable={false} />);
btn.find('Button').simulate('click');
expect(mod.downloadAsPDF).toHaveBeenCalled();
......
import { translate } from './utils'
import { translate, translateTypetoKey, translateToMonth, translateChartType } from './utils'
describe('utils', () => {
it('translates jenis kelamin', () => {
const ret_val = translate("male");
expect(ret_val).toEqual("Pria");
})
it('translates tipe data', () => {
const ret_val = translateTypetoKey("Kecamata");
expect(ret_val).toEqual("district");
})
it('translates bulan', () => {
const ret_val = translateToMonth("01");
expect(ret_val).toEqual("Januari");
})
it('translates tipe chart', () => {
const ret_val = translateChartType(false);
expect(ret_val).toEqual("Bar");
})
})
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment