Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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},`))
})
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},`))
})
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},`))
})
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");
}
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', []);
});
});
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();
};
const getByText = (text, options) =>
createWrapper(getByTextHelper(wrapper.element, text, options));
const getByText = (text, options) =>
createWrapper(getByTextHelper(wrapper.element, text, options));
const getByText = (text, options) =>
createWrapper(getByTextHelper(wrapper.element, text, options));