Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for multiple arguments is missing #6

Open
rschulz-scisys opened this issue Sep 7, 2023 · 0 comments
Open

support for multiple arguments is missing #6

rschulz-scisys opened this issue Sep 7, 2023 · 0 comments

Comments

@rschulz-scisys
Copy link

rschulz-scisys commented Sep 7, 2023

we use signalr not with a single payload, but with multiple arguments. The other signalr cypress plugin supported this.

    // previous implementation
    cy.hubPublish(HubOnMethod.onEntity, 'planning-lists', dataTable.hashes()[0].id, dataTable.hashes()[0]]);

The problem is, to make the tests work, we need to wrap the arguments in an object and have now a second path in the code, checking for the presence of cypress to then check if the payload has an arguments property to then handle that correctly. But we cannot change the interface of the microservices. So this is not very nice:

    // updated implementation
    cy.hubPublish('/hubs/entities', HubOnMethod.onEntity, {
      arguments: ['planning-lists', dataTable.hashes()[0].id, dataTable.hashes()[0]],
    });

The side path in the fgrontend looks similar to this:

      this._connection.on(
        'onEntity',
        (entityType: string | any, entities: Entity[], count: number) => {
          // the new cypress signalr mock can not send multiple arguments, we need to spread it
          if (entityType.arguments) {
            this.process(entityType.arguments[0], entityType.arguments[1], entityType.arguments[2]);
          } else {
            this.process(entityType, entities, count);
          }
        }
      );

I would like to avoid having t6hat separate path in the real code that is only needed in cypress testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant