ShareDrawer: Test coverage (#93111)

This commit is contained in:
Juan Cabanas
2024-09-13 11:01:21 -03:00
committed by GitHub
parent c87b3c4bbf
commit c56870e511
23 changed files with 957 additions and 57 deletions
+29
View File
@@ -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 {};
-2
View File
@@ -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;