ShareDrawer: Test coverage (#93111)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Cypress {
|
||||
interface Chainable {
|
||||
copyToClipboard(): Chainable;
|
||||
copyFromClipboard(): Chainable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cypress.Commands.add('copyFromClipboard', () => {
|
||||
return cy.window().then((win) => {
|
||||
return cy.wrap(win.navigator.clipboard.readText());
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add(
|
||||
'copyToClipboard',
|
||||
{
|
||||
prevSubject: [],
|
||||
},
|
||||
(subject: string) => {
|
||||
return cy.window().then((win) => {
|
||||
return cy.wrap(win.navigator.clipboard.writeText(subject));
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
export {};
|
||||
@@ -1,5 +1,3 @@
|
||||
import { e2e } from '../index';
|
||||
|
||||
const getBaseUrl = () => Cypress.env('BASE_URL') || Cypress.config().baseUrl || 'http://localhost:3000';
|
||||
|
||||
export const fromBaseUrl = (url = '') => new URL(url, getBaseUrl()).href;
|
||||
|
||||
Reference in New Issue
Block a user