Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(storage-browser): add e2e test for offline Create folder action #5759

Open
wants to merge 23 commits into
base: feat-storage-browser/main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f63a675
chore(storage-browser): set up e2e tests for storage browser
timngyn Aug 23, 2024
d712b0a
remove unused variable
timngyn Aug 23, 2024
1bd1f93
remove unused var
timngyn Aug 23, 2024
867df3e
Merge branch 'feat-storage-browser/main' into feat-storage-browser/e2…
timngyn Aug 28, 2024
83fdc3b
add e2e tests for create folder
timngyn Aug 28, 2024
a93eb9e
add e2e tests for navigate control
timngyn Aug 28, 2024
0d80349
remove render-storage-browser.feature
timngyn Aug 28, 2024
5c4bcee
add e2e tests for download file
timngyn Aug 28, 2024
c96c5a9
Merge branch 'feat-storage-browser/main' into feat-storage-browser/e2…
jordanvn Aug 30, 2024
e583231
chore: add tests for 403 response and error boundary to forbidden act…
jordanvn Sep 3, 2024
143cc08
chore: making more generic references to button contents
jordanvn Sep 3, 2024
050ea17
chore: temporarily removing status code validation prior to cleaner a…
jordanvn Sep 3, 2024
7c0287e
chore: restoring resolution to unauthed tests with cleaner solution
jordanvn Sep 3, 2024
5ebdece
Merge branch 'feat-storage-browser/main' into feat-storage-browser/e2…
jordanvn Sep 3, 2024
18c3d4c
chore: removing file download test for now to ensure passing pipeline…
jordanvn Sep 3, 2024
f4daeb2
chore: add newline charactersd
jordanvn Sep 4, 2024
b72bfef
chore: adding additional newline character
jordanvn Sep 4, 2024
9bd0047
Merge branch 'feat-storage-browser/main' into feat-storage-browser/e2…
hbuchel Sep 5, 2024
f78ea18
Merge branch 'feat-storage-browser/main' into feat-storage-browser/e2…
hbuchel Sep 5, 2024
e132e3c
add offline Create Folder e2e test
hbuchel Sep 6, 2024
4298f4d
add new line
hbuchel Sep 6, 2024
983d068
merge latest
hbuchel Oct 11, 2024
d196e6d
remove file leftover before merge
hbuchel Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { When } from '@badeball/cypress-cucumber-preprocessor';
import { escapeRegExp } from 'lodash';

When('I click the "Create Folder" button while offline', () => {
cy.intercept('', (req) => {
req.destroy();
});

cy.findByRole('button', {
name: new RegExp(`^${escapeRegExp('Create Folder')}$`, 'i'),
}).click();
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,19 @@ Feature: Create folder with Storage Browser
When I type a new "Enter folder name:" with value "Blackberry/"
When I lose focus on "Enter folder name:" input
Then I see "Folder name must be at least one character and cannot contain a \"/\"."

@react
Scenario: Create folder shows a Network error if offline
When I type my "email" with status "CONFIRMED"
Then I type my password
Then I click the "Sign in" button
When I click the button containing "public"
Then I see the "Actions" button
When I click the "Actions" button
Then I see the "Create Folder" menuitem
Then I click the "Create Folder" menuitem
Then I see "Enter folder name:"
Then I type a new "Enter folder name:" with value "Blackberry/"
When I click the "Create Folder" button while offline
Then I see "Network Error"

Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export const LocationDetailViewControls = (): React.JSX.Element => {
const [state] = useControl('NAVIGATE');
const { path } = state;

const [{ data, isLoading, hasError }, handleList] = useAction('LIST_LOCATION_ITEMS');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier change, though I'm not sure why it wasn't already there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been getting this a lot, there seems to be some non-deterministic behavior with our prettier setup

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure your VSCode (not you personally, but all of us) is using the project's version of prettier and not a globally installed one

const [{ data, isLoading, hasError }, handleList] = useAction(
'LIST_LOCATION_ITEMS'
);
const [, handleLocationActionsState] = useControl('LOCATION_ACTIONS');

const { result, nextToken } = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('LocationDetailView', () => {
hasError: true,
message: errorMessage,
result: [{ key: 'test1', type: 'FOLDER' }],
nextToken: 'some-token'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier change, though I'm not sure why it wasn't already there.

nextToken: 'some-token',
});

render(
Expand Down
Loading