summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/jsonBuilders/mocks/permission.mock.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/cypress/support/jsonBuilders/mocks/permission.mock.ts')
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/mocks/permission.mock.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/permission.mock.ts b/vid-webpack-master/cypress/support/jsonBuilders/mocks/permission.mock.ts
new file mode 100644
index 000000000..a69d72566
--- /dev/null
+++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/permission.mock.ts
@@ -0,0 +1,29 @@
+declare namespace Cypress {
+ interface Chainable {
+ permissionVidMock: typeof permissionVidMock;
+ initDrawingBoardUserPermission : typeof initDrawingBoardUserPermission;
+ }
+}
+
+
+
+function initDrawingBoardUserPermission( response?: any , delay?: number, status?: number) : void {
+ cy.server()
+ .route({
+ method: 'GET',
+ delay : delay ? delay : 0,
+ status : status ? status : 200,
+ url : Cypress.config('baseUrl') + "/roles/service_permissions?**",
+ response : response ? response : {
+ isEditPermitted : true
+ }
+ }).as('isEditPermitted');
+}
+
+function permissionVidMock(): void {
+ initDrawingBoardUserPermission();
+}
+
+
+Cypress.Commands.add('permissionVidMock', permissionVidMock);
+Cypress.Commands.add('initDrawingBoardUserPermission', initDrawingBoardUserPermission);