2.12.0 • Published 19 hours ago

@luigi-project/testing-utilities v2.12.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
19 hours ago

Luigi Testing Utilities

Luigi Testing Utilities is a set of auxiliary functions used to enhance the user experience while testing Luigi based microfrontends. The functions abstract away Luigi specific logic from the tester so that it is easier for them to test.

LuigiMockUtil

This class contains certain utility helper functions needed especially in e2e-testing with protractor. You can simply import this module into you project and then use an instance of it to test microfrontend functionality.

Example Usage

import { browser } from 'protractor'; // <-- target e2e testing library
import { LuigiMockUtil } from "@luigi-project/testing-utilities";

describe('Another test', () => {
  let luigiMockUtil: LuigiMockUtil;

  beforeAll(async () => {
    luigiMockUtil = new LuigiMockUtil(browser);
  });

  it('should load the page if correct luigi context provided', async () => {
    await luigiMockUtil.mockContext({
      someData: '1',
      someOtherData: 'randomInfo',
    });
  }

Functions provided

  • mockContext: Mocks the context by sending luigi context messegaes with the desired mocked context as parameter.
  • mockPathExists: This method serves as a mock for the luigi client pathExists() function. It is used in e2e tests when component being tested utilizes a call to LuigiClient.linkManager().pathExists()
  • modalOpenedWithTitle: Checks on the printed DOM Luigi message responses for a modal with given title having been opened. In such a case a message would be printed containing a modal.title. Returns false if not such element was found.
  • getMSG: Return list of messages, representing message elements added in the DOM for testing.
  • parseLuigiMockedMessages: Parses the elements added by LuigiMockModule into the DOM and assigns them to the local messages variable
2.12.0

9 days ago

2.11.0

23 days ago

2.10.0

1 month ago

2.9.0

3 months ago

2.8.0

4 months ago

2.7.5

5 months ago

2.7.4

5 months ago

2.4.0

9 months ago

2.3.0

10 months ago

2.3.0-rc5

10 months ago

2.7.0

7 months ago

2.7.2

6 months ago

2.7.1

7 months ago

2.6.1

8 months ago

2.6.0

8 months ago

2.6.3

7 months ago

2.6.2

8 months ago

2.7.3

5 months ago

2.5.0

9 months ago

2.5.1

8 months ago

2.2.1

12 months ago

2.2.0

1 year ago

2.3.0-rc1

1 year ago

2.3.0-rc2

1 year ago

2.3.0-rc3

12 months ago

2.3.0-rc4

12 months ago

2.1.0

1 year ago

2.2.0-rc1

1 year ago

2.2.0-rc2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

2.0.0-rc7

1 year ago

2.0.0-rc6

1 year ago

2.0.0-rc8

1 year ago

1.26.0

1 year ago

2.0.0-rc5

1 year ago

2.0.0-rc4

1 year ago

2.0.0-rc3

1 year ago

2.0.0-rc2

1 year ago

2.0.0-rc1

1 year ago

1.25.0

2 years ago

1.25.1

2 years ago

1.23.0

2 years ago

1.23.1

2 years ago

1.24.0

2 years ago

1.22.0

2 years ago

1.21.0

2 years ago

1.20.1

2 years ago

1.19.0

2 years ago

1.18.1

3 years ago

1.20.0

2 years ago

1.18.0

3 years ago

1.17.0

3 years ago

1.16.2

3 years ago

1.16.1

3 years ago

1.16.0

3 years ago

1.15.0

3 years ago

1.14.3

3 years ago

1.14.1

3 years ago

1.14.2

3 years ago

1.14.0

3 years ago