mirror of
https://github.com/strapi/strapi.git
synced 2025-11-15 17:49:57 +00:00
lint
This commit is contained in:
parent
21845bb0d0
commit
f30f25ecbe
@ -327,7 +327,7 @@ describe('API Token', () => {
|
|||||||
// first call to load original permissions
|
// first call to load original permissions
|
||||||
.mockResolvedValueOnce(
|
.mockResolvedValueOnce(
|
||||||
Promise.resolve(
|
Promise.resolve(
|
||||||
originalToken.permissions.map(p => {
|
originalToken.permissions.map((p) => {
|
||||||
return {
|
return {
|
||||||
action: p,
|
action: p,
|
||||||
};
|
};
|
||||||
@ -337,7 +337,7 @@ describe('API Token', () => {
|
|||||||
// second call to check new permissions
|
// second call to check new permissions
|
||||||
.mockResolvedValueOnce(
|
.mockResolvedValueOnce(
|
||||||
Promise.resolve(
|
Promise.resolve(
|
||||||
updatedAttributes.permissions.map(p => {
|
updatedAttributes.permissions.map((p) => {
|
||||||
return {
|
return {
|
||||||
action: p,
|
action: p,
|
||||||
};
|
};
|
||||||
@ -433,7 +433,7 @@ describe('API Token', () => {
|
|||||||
// first call to load original permissions
|
// first call to load original permissions
|
||||||
.mockResolvedValueOnce(
|
.mockResolvedValueOnce(
|
||||||
Promise.resolve(
|
Promise.resolve(
|
||||||
originalToken.permissions.map(p => {
|
originalToken.permissions.map((p) => {
|
||||||
return {
|
return {
|
||||||
action: p,
|
action: p,
|
||||||
};
|
};
|
||||||
@ -443,7 +443,7 @@ describe('API Token', () => {
|
|||||||
// second call to check new permissions
|
// second call to check new permissions
|
||||||
.mockResolvedValueOnce(
|
.mockResolvedValueOnce(
|
||||||
Promise.resolve(
|
Promise.resolve(
|
||||||
originalToken.permissions.map(p => {
|
originalToken.permissions.map((p) => {
|
||||||
return {
|
return {
|
||||||
action: p,
|
action: p,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -115,7 +115,7 @@ describe('API Token Auth Strategy', () => {
|
|||||||
|
|
||||||
// mock ability.can (since normally it only gets added to credentials in authenticate)
|
// mock ability.can (since normally it only gets added to credentials in authenticate)
|
||||||
const ability = {
|
const ability = {
|
||||||
can: jest.fn(ability => {
|
can: jest.fn((ability) => {
|
||||||
if (customApiToken.permissions.includes(ability)) return true;
|
if (customApiToken.permissions.includes(ability)) return true;
|
||||||
return false;
|
return false;
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user