UNPKG

react-permissions-dynamic

Version:
21 lines (20 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const defaultAllowLogic_1 = require("./defaultAllowLogic"); describe('defaultAllowLogic', () => { it('must handle different same of arrays', () => { expect((0, defaultAllowLogic_1.defaultAllowLogic)(['1', '2', '3'], [], ['1', '2', '3'])).toBe(true); }); it('must handle different order of arrays', () => { expect((0, defaultAllowLogic_1.defaultAllowLogic)(['1', '2', '3'], [], ['3', '1', '2'])).toBe(true); }); it('must return true if no permissions denied', () => { expect((0, defaultAllowLogic_1.defaultAllowLogic)(['1'], [], ['1'])).toBe(true); }); it('must return false if any permissions denied', () => { expect((0, defaultAllowLogic_1.defaultAllowLogic)(['1'], ['2'], ['1'])).toBe(false); }); it('must return false if not all permissions are allowed', () => { expect((0, defaultAllowLogic_1.defaultAllowLogic)(['1'], [], ['1', '2'])).toBe(false); }); });