From 5664c0f26d31119a269e64859ea2ae5e87b0f31e Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sun, 1 Mar 2026 08:01:29 +0100 Subject: [PATCH] remove e2e relics --- features/support/steps.js | 46 -------------------------------------- features/webfinger.feature | 36 ----------------------------- features/world.js | 38 ------------------------------- 3 files changed, 120 deletions(-) delete mode 100644 features/support/steps.js delete mode 100644 features/webfinger.feature delete mode 100644 features/world.js diff --git a/features/support/steps.js b/features/support/steps.js deleted file mode 100644 index 67127fa1e..000000000 --- a/features/support/steps.js +++ /dev/null @@ -1,46 +0,0 @@ -// features/support/steps.js -import { Given, When, Then, After, AfterAll } from 'cucumber' -import Factory, { cleanDatabase } from '../../backend/src/db/factories' -import dotenv from 'dotenv' -import expect from 'expect' - -const debug = require('debug')('ea:test:steps') - -After(async () => { - await cleanDatabase() -}) - -Given('our CLIENT_URI is {string}', function (string) { - expect(string).toEqual('http://localhost:3000') - // This is just for documentation. When you see URLs in the response of - // scenarios you, should be able to tell that it's coming from this - // environment variable. -}); - -Given('we have the following users in our database:', function (dataTable) { - return Promise.all(dataTable.hashes().map(({ slug, name }) => { - return Factory.build('user', { - name, - slug, - }) - })) -}) - -When('I send a GET request to {string}', async function (pathname) { - const response = await this.get(pathname) - this.lastContentType = response.lastContentType - - this.lastResponses.push(response.lastResponse) - this.statusCode = response.statusCode -}) - -Then('the server responds with a HTTP Status {int} and the following json:', function (statusCode, docString) { - expect(this.statusCode).toEqual(statusCode) - const [ lastResponse ] = this.lastResponses - expect(JSON.parse(lastResponse)).toMatchObject(JSON.parse(docString)) -}) - -Then('the Content-Type is {string}', function (contentType) { - expect(this.lastContentType).toEqual(contentType) -}) - diff --git a/features/webfinger.feature b/features/webfinger.feature deleted file mode 100644 index 1a17e7ea3..000000000 --- a/features/webfinger.feature +++ /dev/null @@ -1,36 +0,0 @@ -Feature: Webfinger discovery - From an external server, e.g. Mastodon - I want to search for an actor alias - In order to follow the actor - - Background: - Given our CLIENT_URI is "http://localhost:3000" - And we have the following users in our database: - | name | slug | - | Peter Lustiger | peter-lustiger | - - Scenario: Search a user - When I send a GET request to "/.well-known/webfinger?resource=acct:peter-lustiger@localhost" - Then the server responds with a HTTP Status 200 and the following json: - """ - { - "subject": "acct:peter-lustiger@localhost:3000", - "links": [ - { - "rel": "self", - "type": "application/activity+json", - "href": "http://localhost:3000/activitypub/users/peter-lustiger" - } - ] - } - """ - And the Content-Type is "application/jrd+json; charset=utf-8" - - Scenario: Search without result - When I send a GET request to "/.well-known/webfinger?resource=acct:nonexisting@localhost" - Then the server responds with a HTTP Status 404 and the following json: - """ - { - "error": "No record found for \"nonexisting@localhost\"." - } - """ diff --git a/features/world.js b/features/world.js deleted file mode 100644 index f46a63d4e..000000000 --- a/features/world.js +++ /dev/null @@ -1,38 +0,0 @@ -import { setWorldConstructor } from 'cucumber' -import request from 'request' - -class CustomWorld { - constructor () { - // webFinger.feature - this.lastResponses = [] - this.lastContentType = null - this.lastInboxUrl = null - this.lastActivity = null - // object-article.feature - this.statusCode = null - } - get (pathname) { - return new Promise((resolve, reject) => { - request(`http://localhost:4000/${this.replaceSlashes(pathname)}`, { - headers: { - 'Accept': 'application/activity+json' - }}, (error, response, body) => { - if (!error) { - resolve({ - lastResponse: body, - lastContentType: response.headers['content-type'], - statusCode: response.statusCode - }) - } else { - reject(error) - } - }) - }) - } - - replaceSlashes (pathname) { - return pathname.replace(/^\/+/, '') - } -} - -setWorldConstructor(CustomWorld)