Skip to content

Commit

Permalink
Hide SSO button (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Or-Geva authored Jun 29, 2023
1 parent 174a1d6 commit 0ee67ed
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
24 changes: 12 additions & 12 deletions src/components/Page/Login/Footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ describe('Footer component', () => {
type: LoginConnectionType.BasicAuthOrToken
}

test('renders the default footer when type is not SSO', () => {
const { getByText } = render(<Footer {...defaultProps} />)
// test('renders the default footer when type is not SSO', () => {
// const { getByText } = render(<Footer {...defaultProps} />)

expect(getByText('Sign In')).toBeInTheDocument()
expect(getByText('Continue With SSO')).toBeInTheDocument()
})
// expect(getByText('Sign In')).toBeInTheDocument()
// expect(getByText('Continue With SSO')).toBeInTheDocument()
// })

test('renders the SSO footer when type is SSO', () => {
const { getByText } = render(<Footer {...defaultProps} type={LoginConnectionType.Sso} />)
Expand Down Expand Up @@ -45,13 +45,13 @@ describe('Footer component', () => {
expect(mockHandleConnectionType).toHaveBeenCalledWith(LoginConnectionType.BasicAuthOrToken)
})

test('calls handleConnectionType with LoginConnectionType.Sso when "Continue With SSO" button is clicked', () => {
const { getByText } = render(<Footer {...defaultProps} />)
const ssoButton = getByText('Continue With SSO')
// test('calls handleConnectionType with LoginConnectionType.Sso when "Continue With SSO" button is clicked', () => {
// const { getByText } = render(<Footer {...defaultProps} />)
// const ssoButton = getByText('Continue With SSO')

fireEvent.click(ssoButton)
// fireEvent.click(ssoButton)

expect(mockHandleConnectionType).toHaveBeenCalledTimes(1)
expect(mockHandleConnectionType).toHaveBeenCalledWith(LoginConnectionType.Sso)
})
// expect(mockHandleConnectionType).toHaveBeenCalledTimes(1)
// expect(mockHandleConnectionType).toHaveBeenCalledWith(LoginConnectionType.Sso)
// })
})
3 changes: 1 addition & 2 deletions src/components/Page/Login/Form.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
justify-content: center;
align-items: center;
gap: 20px;
margin-top: 10px;
margin-bottom: 0px;
width: 320px;
transition: height 0.5s ease;
Expand Down Expand Up @@ -60,10 +59,10 @@
}

.ssoBtn {
display: none;
color: rgb(0, 168, 252);
cursor: pointer;
font-size: x-small;
display: flex;
flex-flow: column;
margin-top: 10px;
align-items: center;
Expand Down
20 changes: 10 additions & 10 deletions src/components/Page/Login/Form.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ describe('Form component', () => {
expect(mockLogin).toHaveBeenCalledTimes(1)
})

test('renders the form with the SSO component when connection type is SSO', () => {
const { getByText } = render(
<eventManagerContext.Provider value={mockEventManager}>
<Form />
</eventManagerContext.Provider>
)
const ssoButton = getByText('Continue With SSO')
fireEvent.click(ssoButton)
expect(getByText('Requires Artifactory version 7.63.1 or higher')).toBeInTheDocument()
})
// test('renders the form with the SSO component when connection type is SSO', () => {
// const { getByText } = render(
// <eventManagerContext.Provider value={mockEventManager}>
// <Form />
// </eventManagerContext.Provider>
// )
// const ssoButton = getByText('Continue With SSO')
// fireEvent.click(ssoButton)
// expect(getByText('Requires Artifactory version 7.63.1 or higher')).toBeInTheDocument()
// })
})
2 changes: 1 addition & 1 deletion src/components/Page/Login/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { ISendLoginEventData, LoginConnectionType } from '../../../model/login'
import { Password } from './Password'
import { AccessToken } from './AccessToken'
import { Sso } from './Sso'
import { Footer } from './Footer'
import { Url } from './Url'
import { Footer } from './Footer'

export function Form(): JSX.Element {
const ctx = useContext(eventManagerContext)
Expand Down
1 change: 0 additions & 1 deletion src/components/Page/Login/Login.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
justify-content: center;
align-items: center;
flex-direction: column;
min-height: 200px;
}

.lineText {
Expand Down

0 comments on commit 0ee67ed

Please sign in to comment.