diff options
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts b/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts index a50e62582ce..9a10d6e29e0 100644 --- a/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { cloneDeep } from 'lodash'; +import { cloneDeep, last } from 'lodash'; import { mockUserToken } from '../../helpers/mocks/token'; import { NewUserToken, TokenType, UserToken } from '../../types/token'; import { generateToken, getTokens, revokeToken } from '../user-tokens'; @@ -100,6 +100,10 @@ export default class UserTokensMock { return cloneDeep(this.tokens); }; + getLastToken = () => { + return last(this.getTokens()); + }; + reset = () => { this.tokens = cloneDeep(defaultTokens); }; |