Skip to content

Commit

Permalink
Merge pull request #450 from ditrit/feature/add_rename_file_folder
Browse files Browse the repository at this point in the history
Feature/add rename file folder
  • Loading branch information
Zorin95670 authored Nov 21, 2023
2 parents b6cba81 + f59fab2 commit 9fb1e86
Show file tree
Hide file tree
Showing 21 changed files with 822 additions and 228 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Hide component detail panel when deleting corresponding component.
* Autosave on component detail panel.
* Debounce of 1 second on file auto-save.
* Add 'Rename' action in FileExplorer file/folder menu.
* Setup conditional features:
* `CF_createDiagram`: allows or prevents user to create a diagram.
* `CF_createDiagramFromTemplate`: allows or prevents user to create a diagram from a template.
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/DiagramsPage/DisplayDiagrams.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Feature: Test diagrams page: display all diagrams

When I click on '[data-cy="component-definitions-item_terrator-plugin"]'
And I click on '[data-cy="component-definition_aws"]'
And I wait 1 second
And I wait 2 seconds
Then I expect '[data-cy="draw-container"]' exists
And I expect '[id^="aws"]' exists

Expand Down
30 changes: 29 additions & 1 deletion cypress/e2e/RoundTrips/TextEditor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,15 @@ Feature: Test roundtrip of the application: text editor

# Go back to the draw view
When I click on '[data-cy="navigation-bar"] [data-cy="modelizer-switch-button"] [aria-pressed="false"]'
And I wait 2 seconds
Then I expect current url is '{{ projectName }}/modelizer/draw\?plugin=terrator-plugin&path=infra'

# Add component
When I click on '[data-cy="component-definitions-item_terrator-plugin"]'
Then I expect '[data-cy="component-definition_aws"]' exists

When I click on '[data-cy="component-definition_aws"]'
And I wait 1 second
And I wait 2 seconds
Then I expect '[data-cy="draw-container"] [id^="aws"]' exists

# Go back to the text view
Expand All @@ -603,3 +604,30 @@ Feature: Test roundtrip of the application: text editor
Then I expect '[data-cy="file-tabs-container"] [data-cy="active-tab"]' is 'new_file.tf'
And I expect '[data-cy="file_infra/new_file.tf"]' exists
And I expect active file content to contain 'provider.*"aws".*{}'

## Rename a folder
When I hover '[data-cy="file-explorer"] [data-cy="folder-button_infra"]' to make it visible
And I click on '[data-cy="file-explorer"] [data-cy="folder-button_infra"]'
Then I expect '[data-cy="file-explorer-action-menu"]' exists

When I click on '[data-cy="file-explorer-action-menu"] [data-cy="rename-file-action-item"]'
Then I expect '[data-cy="rename-file-dialog"]' exists

When I set on '[data-cy="rename-file-form"] [data-cy="name-input"]' text ''
And I click on '[data-cy="rename-file-form"] [data-cy="submit-button"]'
Then I expect '[data-cy="rename-file-form"] [role="alert"]' is 'Please type something'

When I set on '[data-cy="rename-file-form"] [data-cy="name-input"]' text 'newFile'
And I click on '[data-cy="rename-file-form"] [data-cy="submit-button"]'
Then I expect '[data-cy="rename-file-form"] [role="alert"]' is 'This name already exists.'

When I set on '[data-cy="rename-file-form"] [data-cy="name-input"]' text 'coucou/infra'
And I click on '[data-cy="rename-file-form"] [data-cy="submit-button"]'
Then I expect '[data-cy="rename-file-form"] [role="alert"]' is 'The name must not contain any \'/\' characters.'

When I set on '[data-cy="rename-file-form"] [data-cy="name-input"]' text 'infra-rename'
And I click on '[data-cy="rename-file-form"] [data-cy="submit-button"]'
Then I expect 'positive' toast to appear with text 'Folder is renamed.'
And I expect '[data-cy="file-explorer"] [data-cy="folder_infra-rename"]' exists
And I expect '[data-cy="file-explorer"] [data-cy="folder_infra"]' not exists
And I expect '[data-cy="file-tabs-container"] [role="tab"]' appear 0 time on screen
Loading

0 comments on commit 9fb1e86

Please sign in to comment.