Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
hana-akamai committed Jan 29, 2024
1 parent cc6cea5 commit a8791c6
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('SubnetLinodeRow', () => {

const handleUnassignLinode = vi.fn();

it('should display linode label, reboot status, VPC IPv4 address, associated firewalls, and Reboot and Unassign buttons', async () => {
it('should display linode label, reboot status, VPC IPv4 address, associated firewalls, IPv4 chip, and Reboot and Unassign buttons', async () => {
const linodeFactory1 = linodeFactory.build({ id: 1, label: 'linode-1' });
server.use(
rest.get('*/instances/*/configs', async (req, res, ctx) => {
Expand Down Expand Up @@ -100,11 +100,15 @@ describe('SubnetLinodeRow', () => {
getAllByText('10.0.0.0');
getByText(mockFirewall0);

const rebootLinodeButton = getAllByRole('button')[1];
const plusChipButton = getAllByRole('button')[1];
expect(plusChipButton).toHaveTextContent('+1');

const rebootLinodeButton = getAllByRole('button')[2];
expect(rebootLinodeButton).toHaveTextContent('Reboot');
fireEvent.click(rebootLinodeButton);
expect(handlePowerActionsLinode).toHaveBeenCalled();
const unassignLinodeButton = getAllByRole('button')[2];

const unassignLinodeButton = getAllByRole('button')[3];
expect(unassignLinodeButton).toHaveTextContent('Unassign Linode');
fireEvent.click(unassignLinodeButton);
expect(handleUnassignLinode).toHaveBeenCalled();
Expand Down

0 comments on commit a8791c6

Please sign in to comment.