Sha256: e9d2a22789e97a0bac2fa91bd1b07c7457bc88d568a894f40cb7691d615b04a3

Contents?: true

Size: 703 Bytes

Versions: 1

Compression:

Stored size: 703 Bytes

Contents

/* global jest, describe, it, expect */
"use strict";

jest.dontMock('../helpers');

var {roleKindFromId} = require('../helpers').__test__;

describe('roleKindFromId', () =>{
    it('parses an id with 3 components correctly', () =>{
        expect(roleKindFromId('companyname:user:bob')).toBe('user');
    });

    it('parses an id with more than three components correctly', ()=>{
       expect(roleKindFromId('a:b:c:d')).toBe('b');
    });

    it('parses an id with 2 components correctly', ()=>{
        expect(roleKindFromId('user:bob')).toBe('user');
    });

    it('returns the id unchanged when it has a single component', () =>{
        expect(roleKindFromId('asdf')).toBe('asdf');
    });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conjur-asset-ui-1.6.0 app/src/components/graph/__tests__/role-kind-from-id-test.js