| 1 | import { describe, expect, test } from 'bun:test'; |
| 2 | |
| 3 | import { administers, atLeast |
| 4 | |
| 5 | describe('atLeast', () |
| 6 | test('ranks on the ladder and treats no role as nothing', |
| 7 | expect(atLeast('maintain |
| 8 | expect(atLeast('write |
| 9 | expect(atLeast(null, |
| 10 | expect(atLeast(undefined, |
| 11 | }); |
| 12 | }); |
| 13 | |
| 14 | describe('organizationRoleOf', () |
| 15 | test('takes the highest built-in role and ignores the rest', |
| 16 | expect(organizationRoleOf('member,admin |
| 17 | expect(organizationRoleOf('billing |
| 18 | expect(organizationRoleOf(null)) |
| 19 | }); |
| 20 | }); |
| 21 | |
| 22 | describe('administers', () |
| 23 | test('is admins and owners', |
| 24 | expect(administers('owner |
| 25 | expect(administers('admin |
| 26 | expect(administers('member |
| 27 | expect(administers(null)) |
| 28 | }); |
| 29 | }); |