-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fixes #381 Added access for SUPER ADMINS only. This has to be a field added in the database manually under the user > labels data field. This should only apply to GIS Developers. ## VIDEO https://github.com/user-attachments/assets/d65b83ce-4ef4-41d5-a2f9-30f55547ebfb --------- Co-authored-by: Shashi Lo <[email protected]>
- Loading branch information
1 parent
6204626
commit a267371
Showing
10 changed files
with
112 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ jest.mock('@/store/dataStore', () => ({ | |
id: '1234', | ||
email: '[email protected]', | ||
leagues: ['league1'], | ||
labels: [], | ||
}, | ||
allLeagues: [ | ||
{ | ||
|
@@ -82,6 +83,7 @@ describe('Leagues Component', () => { | |
leagues: [], | ||
}, | ||
allLeagues: [], | ||
labels: [], | ||
}); | ||
|
||
render(<Leagues />); | ||
|
@@ -105,6 +107,7 @@ describe('Leagues Component', () => { | |
leagues: [], | ||
}, | ||
allLeagues: [], | ||
labels: [], | ||
}); | ||
|
||
render(<Leagues />); | ||
|
@@ -121,6 +124,7 @@ describe('Leagues Component', () => { | |
email: '[email protected]', | ||
id: '123', | ||
leagues: [], | ||
labels: [], | ||
}, | ||
allLeagues: [ | ||
{ | ||
|
@@ -150,6 +154,7 @@ describe('Leagues Component', () => { | |
email: '[email protected]', | ||
id: '123', | ||
leagues: [], | ||
labels: [], | ||
}; | ||
|
||
const league = { | ||
|
@@ -202,6 +207,7 @@ describe('Leagues Component', () => { | |
user.id, | ||
user.email, | ||
[...user.leagues, league.leagueId], | ||
user.labels, | ||
); | ||
expect(toast.custom).toHaveBeenCalledWith( | ||
<Alert | ||
|
@@ -220,6 +226,7 @@ describe('Leagues Component', () => { | |
email: '[email protected]', | ||
id: '123', | ||
leagues: [], | ||
labels: [], | ||
}; | ||
|
||
const league = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ const userData = { | |
id: '123', | ||
email: '[email protected]', | ||
leagues: ['123456'], | ||
labels: ['admin'], | ||
}; | ||
|
||
const NFLTeams = [ | ||
|
@@ -61,11 +62,14 @@ describe('Data Store', () => { | |
userData.userId, | ||
userData.userEmail, | ||
userData.leagues, | ||
userData.labels, | ||
); | ||
}); | ||
|
||
expect(result.current.user.id).toBe(userData.userId); | ||
expect(result.current.user.email).toBe(userData.userEmail); | ||
expect(result.current.user.labels).toStrictEqual(userData.labels); | ||
expect(result.current.user.leagues).toStrictEqual(userData.leagues); | ||
}); | ||
it('Checks the reset user state matches default', () => { | ||
const { result } = renderHook(() => useDataStore()); | ||
|
@@ -76,12 +80,15 @@ describe('Data Store', () => { | |
userData.userId, | ||
userData.userEmail, | ||
userData.leagues, | ||
userData.labels, | ||
); | ||
result.current.resetUser(); | ||
}); | ||
|
||
expect(result.current.user.id).toBe(''); | ||
expect(result.current.user.email).toBe(''); | ||
expect(result.current.user.labels).toStrictEqual([]); | ||
expect(result.current.user.leagues).toStrictEqual([]); | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters