Skip to content

Commit

Permalink
fix: Move payloads to e2e folder (#452)
Browse files Browse the repository at this point in the history
* Move payloads to e2e folder

* Fix paths to payloads in tests

* Fix CHANGELOG

* Fix CHANGELOG
  • Loading branch information
Andrew Nikitin committed Dec 26, 2023
1 parent 138c09d commit a20e80d
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 37 deletions.
21 changes: 0 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
# Changelog

## [2.14.0-develop.1](https://github.com/cheqd/credential-service/compare/2.13.0...2.14.0-develop.1) (2023-12-26)


### Features

* Add key/import api [DEV-3486] ([#448](https://github.com/cheqd/credential-service/issues/448)) ([524cebb](https://github.com/cheqd/credential-service/commit/524cebb5542b8a0d639decf7820929d52dacd05a))

## [2.13.0](https://github.com/cheqd/credential-service/compare/2.12.0...2.13.0) (2023-12-22)


### Features

* Add more validation for user requests [DEV-3453] ([#443](https://github.com/cheqd/credential-service/issues/443)) ([109c518](https://github.com/cheqd/credential-service/commit/109c518355392e54ee7228a5b94b539b64ed9469)), closes [#19](https://github.com/cheqd/credential-service/issues/19)

## [2.13.0-develop.1](https://github.com/cheqd/credential-service/compare/2.12.0...2.13.0-develop.1) (2023-12-22)


### Features

* Add more validation for user requests [DEV-3453] ([#443](https://github.com/cheqd/credential-service/issues/443)) ([109c518](https://github.com/cheqd/credential-service/commit/109c518355392e54ee7228a5b94b539b64ed9469)), closes [#19](https://github.com/cheqd/credential-service/issues/19)

## [2.12.0](https://github.com/cheqd/credential-service/compare/2.11.0...2.12.0) (2023-12-20)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cheqd/credential-service",
"version": "2.14.0-develop.1",
"version": "2.12.0",
"description": "cheqd Credential Service Backend",
"source": "src/index.ts",
"main": "dist/index.js",
Expand Down
10 changes: 4 additions & 6 deletions tests/e2e/credential/issue-verify-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import type { VerifiableCredential } from '@veramo/core';
import { test, expect } from '@playwright/test';
import { StatusCodes } from 'http-status-codes';
import * as fs from 'fs';
import { CONTENT_TYPE } from '../constants';
import { CONTENT_TYPE, PAYLOADS_PATH } from '../constants';

test.use({ storageState: 'playwright/.auth/user.json' });

const PAYLOADS_BASE_PATH = './tests/payloads/credential';

let jwtCredential: VerifiableCredential, jsonldCredential: VerifiableCredential;

test(' Issue a jwt credential', async ({ request }) => {
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jwt.json`, 'utf-8'));
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jwt.json`, 'utf-8'));
const response = await request.post(`/credential/issue`, {
data: JSON.stringify(credentialData),
headers: {
Expand Down Expand Up @@ -50,7 +48,7 @@ test(' Verify a jwt credential', async ({ request }) => {
});

test(' Issue a jwt credential with a deactivated DID', async ({ request }) => {
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jwt.json`, 'utf-8'));
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jwt.json`, 'utf-8'));
credentialData.issuerDid = 'did:cheqd:testnet:edce6dfb-b59c-493b-a4b8-1d16a6184349';
const response = await request.post(`/credential/issue`, {
data: JSON.stringify(credentialData),
Expand All @@ -62,7 +60,7 @@ test(' Issue a jwt credential with a deactivated DID', async ({ request }) => {
});

test(' Issue a jsonLD credential', async ({ request }) => {
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jsonld.json`, 'utf-8'));
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jsonld.json`, 'utf-8'));
const response = await request.post(`/credential/issue`, {
data: JSON.stringify(credentialData),
headers: {
Expand Down
6 changes: 2 additions & 4 deletions tests/e2e/credential/revocation-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ import type { VerifiableCredential } from '@veramo/core';
import { test, expect } from '@playwright/test';
import { StatusCodes } from 'http-status-codes';
import * as fs from 'fs';
import { CONTENT_TYPE } from '../constants';
import { CONTENT_TYPE, PAYLOADS_PATH } from '../constants';

test.use({ storageState: 'playwright/.auth/user.json' });

const PAYLOADS_BASE_PATH = './tests/payloads/credential';

let jwtCredential: VerifiableCredential;

test(' Issue a jwt credential with revocation statuslist', async ({ request }) => {
const credentialData = JSON.parse(
fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jwt-revocation.json`, 'utf-8')
fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jwt-revocation.json`, 'utf-8')
);
const response = await request.post(`/credential/issue`, {
data: JSON.stringify(credentialData),
Expand Down
6 changes: 2 additions & 4 deletions tests/e2e/credential/suspension-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ import type { VerifiableCredential } from '@veramo/core';
import { test, expect } from '@playwright/test';
import { StatusCodes } from 'http-status-codes';
import * as fs from 'fs';
import { CONTENT_TYPE } from '../constants';
import { CONTENT_TYPE, PAYLOADS_PATH } from '../constants';

test.use({ storageState: 'playwright/.auth/user.json' });

const PAYLOADS_BASE_PATH = './tests/payloads/credential';

let jwtCredential: VerifiableCredential;

test(' Issue a jwt credential with suspension statuslist', async ({ request }) => {
const credentialData = JSON.parse(
fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jwt-revocation.json`, 'utf-8')
fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jwt-revocation.json`, 'utf-8')
);
credentialData.credentialStatus.statusPurpose = 'suspension';
const response = await request.post(`/credential/issue`, {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/did/create-positive.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ID_TYPE, DEFAULT_CONTEXT, CONTENT_TYPE } from '../constants';

Check failure on line 1 in tests/e2e/did/create-positive.spec.ts

View workflow job for this annotation

GitHub Actions / Build & Test / Build Node.js

[Logged In User Tests] › did/create-positive.spec.ts:82:1 › [Positive] It can create DID with mandatory properties (JSON based + Indy style)

2) [Logged In User Tests] › did/create-positive.spec.ts:82:1 › [Positive] It can create DID with mandatory properties (JSON based + Indy style) Test timeout of 60000ms exceeded.
import { v4 } from 'uuid';
import { buildSimpleService } from 'helpers';
import { buildSimpleService } from '../helpers';
import { test, expect } from '@playwright/test';
import { StatusCodes } from 'http-status-codes';

Expand Down

0 comments on commit a20e80d

Please sign in to comment.