Skip to content

Commit

Permalink
Fix APITokens utils failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjac0bs committed Dec 13, 2023
1 parent 1f2d593 commit adb0d02
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/manager/src/features/Profile/APITokens/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('APIToken utils', () => {
const result = scopeStringToPermTuples('*');
const expected = [
['account', 2],
['child_account', 2],
['databases', 2],
['domains', 2],
['events', 2],
Expand All @@ -49,6 +50,7 @@ describe('APIToken utils', () => {
const result = scopeStringToPermTuples('');
const expected = [
['account', 0],
['child_account', 0],
['databases', 0],
['domains', 0],
['events', 0],
Expand All @@ -73,6 +75,7 @@ describe('APIToken utils', () => {
const result = scopeStringToPermTuples('account:none');
const expected = [
['account', 0],
['child_account', 0],
['databases', 0],
['domains', 0],
['events', 0],
Expand All @@ -97,6 +100,7 @@ describe('APIToken utils', () => {
const result = scopeStringToPermTuples('account:read_only');
const expected = [
['account', 1],
['child_account', 0],
['databases', 0],
['domains', 0],
['events', 0],
Expand All @@ -121,6 +125,7 @@ describe('APIToken utils', () => {
const result = scopeStringToPermTuples('account:read_write');
const expected = [
['account', 2],
['child_account', 0],
['databases', 0],
['domains', 0],
['events', 0],
Expand All @@ -147,6 +152,7 @@ describe('APIToken utils', () => {
);
const expected = [
['account', 0],
['child_account', 0],
['databases', 0],
['domains', 1],
['events', 0],
Expand Down Expand Up @@ -175,6 +181,7 @@ describe('APIToken utils', () => {
const result = scopeStringToPermTuples('account:none,tokens:read_write');
const expected = [
['account', 2],
['child_account', 0],
['databases', 0],
['domains', 0],
['events', 0],
Expand Down Expand Up @@ -203,6 +210,7 @@ describe('APIToken utils', () => {
const result = scopeStringToPermTuples('account:read_only,tokens:none');
const expected = [
['account', 1],
['child_account', 0],
['databases', 0],
['domains', 0],
['events', 0],
Expand All @@ -227,6 +235,7 @@ describe('APIToken utils', () => {
it('should return 0 if all scopes are 0', () => {
const scopes: Permission[] = [
['account', 0],
['child_account', 0],
['databases', 0],
['domains', 0],
['events', 0],
Expand All @@ -246,6 +255,7 @@ describe('APIToken utils', () => {
it('should return 1 if all scopes are 1', () => {
const scopes: Permission[] = [
['account', 1],
['child_account', 1],
['databases', 1],
['domains', 1],
['events', 1],
Expand All @@ -265,6 +275,7 @@ describe('APIToken utils', () => {
it('should return 2 if all scopes are 2', () => {
const scopes: Permission[] = [
['account', 2],
['child_account', 2],
['databases', 2],
['domains', 2],
['events', 2],
Expand All @@ -284,6 +295,7 @@ describe('APIToken utils', () => {
it('should return null if all scopes are different', () => {
const scopes: Permission[] = [
['account', 1],
['child_account', 0],
['databases', 0],
['domains', 2],
['events', 0],
Expand Down

0 comments on commit adb0d02

Please sign in to comment.