-
Notifications
You must be signed in to change notification settings - Fork 19
Add detach button for ephemeral ip #2285
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c641f5b
add detach button for ephemeral IP
charliepark 67461ec
refactor
charliepark ac8c2d6
add empty state for external ips
charliepark 5a06700
capitalize modal title
charliepark cfebace
refine copy
charliepark 1159d55
Update modal title to reflect that this is a confirmation step
charliepark 5bcad53
clinging to detachment is its own form of attachment
charliepark 9804e81
copy tweak
charliepark 1f75c73
Update query to rely on ip passed in as query param; need to talk thr…
charliepark 3602cf7
Update attach branch with changes from detach branch
charliepark a425b46
more precise message for error
charliepark 6be7425
add assertion to establish row's presence
charliepark c0f9f5e
refactor test
charliepark d68e921
fix notFoundErr copy
charliepark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,13 +87,14 @@ test('Instance networking tab — NIC table', async ({ page }) => { | |
| test('Instance networking tab — External IPs', async ({ page }) => { | ||
| await page.goto('/projects/mock-project/instances/db1/network-interfaces') | ||
| const externalIpTable = page.getByRole('table', { name: 'External IPs' }) | ||
| const attachFloatingIpButton = page.getByRole('button', { name: 'Attach floating IP' }) | ||
|
|
||
| // See list of external IPs | ||
| await expectRowVisible(externalIpTable, { ip: '123.4.56.0', Kind: 'ephemeral' }) | ||
| await expectRowVisible(externalIpTable, { ip: '123.4.56.5', Kind: 'floating' }) | ||
|
|
||
| // Attach a new external IP | ||
| await page.click('role=button[name="Attach floating IP"]') | ||
| await attachFloatingIpButton.click() | ||
| await expectVisible(page, ['role=heading[name="Attach floating IP"]']) | ||
|
|
||
| // Select the 'rootbeer-float' option | ||
|
|
@@ -111,15 +112,21 @@ test('Instance networking tab — External IPs', async ({ page }) => { | |
| await expectRowVisible(externalIpTable, { name: 'rootbeer-float' }) | ||
|
|
||
| // Verify that the "Attach floating IP" button is disabled, since there shouldn't be any more IPs to attach | ||
| await expect(page.getByRole('button', { name: 'Attach floating IP' })).toBeDisabled() | ||
| await expect(attachFloatingIpButton).toBeDisabled() | ||
|
|
||
| // Detach one of the external IPs | ||
| await clickRowAction(page, 'cola-float', 'Detach') | ||
| await page.getByRole('button', { name: 'Confirm' }).click() | ||
|
|
||
| // Since we detached it, we don't expect to see db1 any longer | ||
| // Since we detached it, we don't expect to see the row any longer | ||
| await expect(externalIpTable.getByRole('cell', { name: 'cola-float' })).toBeHidden() | ||
|
|
||
| // And that button shouldbe enabled again | ||
| await expect(page.getByRole('button', { name: 'Attach floating IP' })).toBeEnabled() | ||
| await expect(attachFloatingIpButton).toBeEnabled() | ||
|
|
||
| // Detach the ephemeral IP | ||
| await expect(externalIpTable.getByRole('cell', { name: 'ephemeral' })).toBeVisible() | ||
| await clickRowAction(page, 'ephemeral', 'Detach') | ||
| await page.getByRole('button', { name: 'Confirm' }).click() | ||
| await expect(externalIpTable.getByRole('cell', { name: 'ephemeral' })).toBeHidden() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add an assert before clicking the row action that this same selector is visible. The |
||
| }) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.