How to use the jest/search/mock_data.MOCK_GROUPS.map function in jest

To help you get started, we’ve selected a few jest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gitlabhq / gitlabhq / spec / frontend / search / topbar / components / searchable_dropdown_spec.js View on Github external
it('renders GlAvatar for each item', () => {
          const avatars = MOCK_GROUPS.map((n) => n.avatar_url);
          expect(findDropdownAvatarUrls()).toStrictEqual(avatars);
        });
      });
github gitlabhq / gitlabhq / spec / frontend / search / topbar / components / searchable_dropdown_spec.js View on Github external
it('renders namespaces truncated correctly', () => {
          const namespaces = MOCK_GROUPS.map((n) => truncateNamespace(n[GROUP_DATA.fullName]));
          expect(findDropdownItemNamespacesText()).toStrictEqual(namespaces);
        });
github gitlabhq / gitlabhq / spec / frontend / search / topbar / components / searchable_dropdown_spec.js View on Github external
it('renders titles correctly including Any', () => {
          const resultsIncludeAny = ['Any'].concat(MOCK_GROUPS.map((n) => n[GROUP_DATA.name]));
          expect(findDropdownItemTitlesText()).toStrictEqual(resultsIncludeAny);
        });