Add tests to APIService.toAPIVersion

parent 518e296c
......@@ -7,6 +7,21 @@ describe("APIService", function() {
});
});
describe('#toAPIVersion', () => {
var tc = [
['build.openshift.io/v1', {group: 'build.openshift.io', version: 'v1', resource: 'builds' }],
['build.openshift.io/v1', {group: 'build.openshift.io', version: 'v1', resource: 'buildconfigs' }],
['v1', {version: 'v1', resource: 'configmaps' }],
[undefined, {resource: 'kangaroos'}],
];
_.each(tc, _.spread((output, input) => {
it('should convert ' + JSON.stringify(input) + ' into ' + output, () => {
expect( APIService.toAPIVersion(input) ).toEqual(output);
});
}));
});
describe("#toResourceGroupVersion", function() {
var tc = [
......
Markdown is supported
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