pgadmin4/web/regression/javascript/schema_ui_files/binary_path.ui.spec.js

42 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

/////////////////////////////////////////////////////////////
//
// pgAdmin 4 - PostgreSQL Tools
//
2024-01-01 02:43:48 -06:00
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
//////////////////////////////////////////////////////////////
import {genericBeforeEach, getEditView} from '../genericFunctions';
import {getBinaryPathSchema} from '../../../pgadmin/browser/server_groups/servers/static/js/binary_path.ui';
import pgAdmin from '../fake_pgadmin';
describe('BinaryPathschema', ()=>{
let schemaObj = getBinaryPathSchema();
let getInitData = ()=>Promise.resolve({});
beforeAll(()=>{
jest.spyOn(pgAdmin.Browser.notifier, 'alert').mockImplementation(() => {});
});
beforeEach(()=>{
genericBeforeEach();
});
it('edit', async ()=>{
await getEditView(schemaObj, getInitData);
});
it('validate path', ()=>{
let validate = _.find(schemaObj.fields, (f)=>f.id=='binaryPath').validate;
let status = validate('');
expect(status).toBe(true);
});
});