From 9503b6f2ee0cd03f372cb66959a2f2770b9d10f7 Mon Sep 17 00:00:00 2001 From: Judy Ng Date: Thu, 22 Feb 2024 14:02:04 -0500 Subject: [PATCH] Add deafault user tests for rhel8 and rhel9 Signed-off-by: Judy Ng --- frontend/src/__tests__/util.test.tsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/frontend/src/__tests__/util.test.tsx b/frontend/src/__tests__/util.test.tsx index db583d50..db5530d7 100644 --- a/frontend/src/__tests__/util.test.tsx +++ b/frontend/src/__tests__/util.test.tsx @@ -44,6 +44,14 @@ describe('Given a function to get the default cluster user', () => { }) }) + describe('when the OS is Ubuntu 18.04', () => { + const cluster = {config: {Image: {Os: 'ubuntu1804'}}} + it('should be ubuntu', () => { + const result = clusterDefaultUser(cluster) + expect(result).toBe('ubuntu') + }) + }) + describe('when the OS is Ubuntu 20.04', () => { const cluster = {config: {Image: {Os: 'ubuntu2004'}}} it('should be ubuntu', () => { @@ -67,4 +75,20 @@ describe('Given a function to get the default cluster user', () => { expect(result).toBe('centos') }) }) + + describe('when the OS is Rhel 8', () => { + const cluster = {config: {Image: {Os: 'rhel8'}}} + it('should be ec2-user', () => { + const result = clusterDefaultUser(cluster) + expect(result).toBe('ec2-user') + }) + }) + + describe('when the OS is Rhel 9', () => { + const cluster = {config: {Image: {Os: 'rhel9'}}} + it('should be ec2-user', () => { + const result = clusterDefaultUser(cluster) + expect(result).toBe('ec2-user') + }) + }) })