-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from trade-tariff/FPO-132-backfill-test-coverage
FPO-132: Fixes test setup
- Loading branch information
Showing
6 changed files
with
81 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
AWS_REGION=eu-west-2 | ||
ENCRYPTION_KEY=Ur2w/rJWwRiLS4LEorod0t8PCgi7mZL9AdfCHwXviRo= | ||
export AWS_REGION=eu-west-2 | ||
export ENCRYPTION_KEY=Ur2w/rJWwRiLS4LEorod0t8PCgi7mZL9AdfCHwXviRo= |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//import { type Request, type Response } from 'express' | ||
//import { type CustomerApiKeyRepository } from '../repositories/customerApiKeyRepository' | ||
//// const allowedKeys = ['description', 'enabled'] | ||
|
||
//export class ApiKeyController { | ||
// // async update (req: Request, res: Response): Promise<void> { | ||
// // const fpoId = req.params.fpoId | ||
// // const id = req.params.id | ||
// // const body = req.body | ||
// // | ||
// // if (typeof body !== 'object') { | ||
// // res.status(400).json({ message: 'Invalid request' }) | ||
// // } | ||
// // const apiKey = await repository.updateKey(fpoId, id, body) | ||
|
||
// // if (apiKey === null) { | ||
// // res.status(404).json({ message: 'Did not succeed' }) | ||
// // } else { | ||
// // res.status(200).json(apiKey.toJson()) | ||
// // } | ||
// // } | ||
// private readonly repository: CustomerApiKeyRepository | ||
|
||
// constructor (repository: CustomerApiKeyRepository) { | ||
// this.repository = repository | ||
// } | ||
|
||
// async show (req: Request, res: Response): Promise<void> { | ||
// const fpoId = req.params.fpoId | ||
// const id = req.params.id | ||
// const apiKey = await this.repository.getKey(fpoId, id) | ||
|
||
// if (apiKey === null) { | ||
// res.status(404).json({ message: 'API key not found' }) | ||
// } else { | ||
// res.json(await apiKey.toDecryptedJson()) | ||
// } | ||
// } | ||
|
||
// async index (req: Request, res: Response): Promise<void> { | ||
// const fpoId = req.params.fpoId | ||
// const apiKeys = await this.repository.listKeys(fpoId) | ||
|
||
// res.json(apiKeys.map(apiKey => apiKey.toJson())) | ||
// } | ||
|
||
// async create (req: Request, res: Response): Promise<void> { | ||
// const fpoId = req.params.fpoId | ||
// const apiKey = await this.repository.createKey(fpoId) | ||
|
||
// res.status(201).json(apiKey.toJson()) | ||
// } | ||
//} | ||
// | ||
import jasmine from 'jasmine' | ||
|
||
import { ApiKeyController } from '../../src/controllers/apiKeysController' | ||
|
||
describe('ApiKeyController', () => { | ||
it('should be defined', () => { | ||
expect(ApiKeyController).toBeDefined() | ||
}) | ||
}) | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import dotenv from 'dotenv' | ||
|
||
dotenv.config({ path: '.env.test' }) |
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