How to use the @testing-library/dom.within function in @testing-library/dom

To help you get started, we’ve selected a few @testing-library/dom 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 / members / components / table / members_table_spec.js View on Github external
it('does not render the "Actions" field', () => {
          createComponent({ members, tableFields: ['actions'] });

          expect(within(wrapper.element).queryByTestId('col-actions')).toBe(null);
        });
      });
github gitlabhq / gitlabhq / spec / frontend / members / components / avatars / user_avatar_spec.js View on Github external
it('does not render 2FA badge when `canManageMembers` is `false`', () => {
      createComponent({ member: member2faEnabled }, { canManageMembers: false });

      expect(within(wrapper.element).queryByText('2FA')).toBe(null);
    });
  });
github gitlabhq / gitlabhq / spec / frontend / access_tokens / components / projects_field_spec.js View on Github external
  const queryByText = (text) => within(wrapper.element).queryByText(text);
  const findAllProjectsRadio = () => queryByLabelText('All projects');
github gitlabhq / gitlabhq / spec / frontend / members / components / table / expires_at_spec.js View on Github external
const getByText = (text, options) =>
    createWrapper(within(wrapper.element).getByText(text, options));
github gitlabhq / gitlabhq / spec / frontend / members / components / modals / leave_modal_spec.js View on Github external
const getByText = (text, options) =>
    createWrapper(within(findModal().element).getByText(text, options));
github gitlabhq / gitlabhq / spec / frontend / members / components / avatars / user_avatar_spec.js View on Github external
const getByText = (text, options) =>
    createWrapper(within(wrapper.element).findByText(text, options));
github gitlabhq / gitlabhq / spec / frontend / members / components / table / role_dropdown_spec.js View on Github external
  const getDropdownMenu = () => within(wrapper.element).getByRole('menu');
  const getByTextInDropdownMenu = (text, options = {}) =>
github gitlabhq / gitlabhq / spec / frontend / members / components / table / created_at_spec.js View on Github external
const getByText = (text, options) =>
    createWrapper(within(wrapper.element).getByText(text, options));
github gitlabhq / gitlabhq / spec / frontend / pipelines / graph_shared / links_layer_spec.js View on Github external
  const withinComponent = () => within(wrapper.element);
  const findAlert = () => wrapper.find(GlAlert);
github gitlabhq / gitlabhq / spec / frontend / members / components / table / role_dropdown_spec.js View on Github external
const getByTextInDropdownMenu = (text, options = {}) =>
    createWrapper(within(getDropdownMenu()).getByText(text, options));
  const getDropdownItemByText = (text) =>