How to use the @testing-library/dom.getByText 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 voluntarily / vly2 / server / api / person / __tests__ / emailperson.spec.js View on Github external
test.serial('render acknowledgeInterest email to person', async t => {
  const props = {
    send: true, // when true email is actually sent
    from: t.context.me,
    op: t.context.op
  }
  const html = await emailPerson('acknowledgeInterest', t.context.to, props, true)
  const document = (new JSDOM(html)).window.document
  t.truthy(getByText(document, 'Help make a difference'))
  t.truthy(getByText(document, t.context.op.name))
  t.truthy(getByText(document, `Kia ora ${t.context.to.nickname},`))
})
github voluntarily / vly2 / server / api / person / __tests__ / emailperson.spec.js View on Github external
test.serial('render acknowledgeInterest email to person', async t => {
  const props = {
    send: true, // when true email is actually sent
    from: t.context.me,
    op: t.context.op
  }
  const html = await emailPerson('acknowledgeInterest', t.context.to, props, true)
  const document = (new JSDOM(html)).window.document
  t.truthy(getByText(document, 'Help make a difference'))
  t.truthy(getByText(document, t.context.op.name))
  t.truthy(getByText(document, `Kia ora ${t.context.to.nickname},`))
})
github voluntarily / vly2 / server / api / person / __tests__ / emailperson.spec.js View on Github external
test.serial('render acknowledgeInterest email to person', async t => {
  const props = {
    send: true, // when true email is actually sent
    from: t.context.me,
    op: t.context.op
  }
  const html = await emailPerson('acknowledgeInterest', t.context.to, props, true)
  const document = (new JSDOM(html)).window.document
  t.truthy(getByText(document, 'Help make a difference'))
  t.truthy(getByText(document, t.context.op.name))
  t.truthy(getByText(document, `Kia ora ${t.context.to.nickname},`))
})
github prettier / prettier-chrome-extension / src / content / testUtils.js View on Github external
export function expectToFormat(textarea) {
  fireEvent.change(textarea, {
    target: { value: "```js\nconst variable=value\n```" }
  });
  fireEvent.click(getByText(document, "Prettier"));
  expect(textarea).toHaveValue("```js\nconst variable = value;\n```\n");
}
github gitlabhq / gitlabhq / spec / frontend / diffs / components / inline_diff_view_spec.js View on Github external
it('should render discussions', () => {
      const diffFile = getDiffFileMock();
      diffFile.highlighted_diff_lines[1].discussions = getDiscussionsMockData();
      diffFile.highlighted_diff_lines[1].discussionsExpanded = true;
      setup(diffFile, diffFile.highlighted_diff_lines);

      expect(wrapper.findAll('.notes_holder').length).toEqual(1);
      expect(wrapper.findAll('.notes_holder .note').length).toEqual(notesLength + 1);
      getByText(wrapper.element, 'comment 5');
      wrapper.vm.$store.dispatch('setInitialNotes', []);
    });
  });
github gitlabhq / gitlabhq / spec / frontend_integration / ide / helpers / ide_helper.js View on Github external
const fillFileNameModal = async (value, submitText = 'Create file') => {
  const modal = await screen.findByTestId('ide-new-entry');

  const nameField = await findByTestId(modal, 'file-name-field');
  fireEvent.input(nameField, { target: { value } });

  const createButton = getByText(modal, submitText, { selector: 'button' });
  createButton.click();
};
github gitlabhq / gitlabhq / spec / frontend / members / components / avatars / group_avatar_spec.js View on Github external
const getByText = (text, options) =>
    createWrapper(getByTextHelper(wrapper.element, text, options));
github gitlabhq / gitlabhq / spec / frontend / members / components / avatars / invite_avatar_spec.js View on Github external
const getByText = (text, options) =>
    createWrapper(getByTextHelper(wrapper.element, text, options));
github gitlabhq / gitlabhq / spec / frontend / members / components / table / member_source_spec.js View on Github external
const getByText = (text, options) =>
    createWrapper(getByTextHelper(wrapper.element, text, options));