Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-deploy-ui
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ccce
dev
ce-deploy-ui
Merge requests
!402
CE-1916
: Remove-React-Testing-Library
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
CE-1916
: Remove-React-Testing-Library
CE-1916-Remove-React-Testing-Library
into
develop
Overview
5
Commits
2
Pipelines
2
Changes
5
1 unresolved thread
Hide all comments
Merged
Alexander Madsen
requested to merge
CE-1916-Remove-React-Testing-Library
into
develop
1 year ago
Overview
5
Commits
2
Pipelines
2
Changes
5
1 unresolved thread
Hide all comments
Expand
Remove RTL tests
0
0
Merge request reports
Viewing commit
7197f697
Prev
Next
Show latest version
5 files
+
0
−
577
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
7197f697
Remove React testing library tests
· 7197f697
Alexander Madsen
authored
1 year ago
src/__tests__/browse-deployments-test.js deleted
100644 → 0
+
0
−
107
Options
import
React
from
"
react
"
;
import
{
loadFeature
,
defineFeature
}
from
"
jest-cucumber
"
;
import
{
render
,
screen
/* , findByText*/
}
from
"
@testing-library/react
"
;
import
App
from
"
../App
"
;
import
{
createMemoryHistory
}
from
"
history
"
;
// mock BrowserRouter (this should probably live somewhere else)
const
reactRouterDom
=
require
(
"
react-router-dom
"
);
reactRouterDom
.
BrowserRouter
=
({
children
})
=>
<
div
>
{
children
}
<
/div>
;
const
Router
=
reactRouterDom
.
Router
;
const
feature
=
loadFeature
(
"
features/deployments/browse-deployments.feature
"
);
defineFeature
(
feature
,
(
test
)
=>
{
test
(
"
User wants to browse IOC deployments
"
,
({
given
,
when
,
then
})
=>
{
given
(
"
the user is not logged in and navigates to the deployments page
"
,
async
()
=>
{
const
history
=
createMemoryHistory
();
history
.
push
(
"
/deployments
"
);
render
(
<
Router
history
=
{
history
}
>
<
App
/>
<
/Router
>
);
await
screen
.
findByText
(
/Running/i
);
}
);
then
(
"
they should not get Access deniend
"
,
async
()
=>
{
expect
(
await
screen
.
findByText
(
/IOC name/i
)).
toBeInTheDocument
();
});
});
test
(
"
User wants to see relevant IOC deployments
"
,
({
given
,
when
,
then
,
and
})
=>
{
given
(
"
the user is on the deployments page
"
,
()
=>
{});
when
(
"
the user clicks on the My deployments toogle button
"
,
()
=>
{});
then
(
"
the table should display only deployments which the user has made
"
,
()
=>
{}
);
and
(
"
recent deployments should be at the top
"
,
()
=>
{});
});
test
(
"
User wants to navigate to a specific IOC deployment
"
,
({
given
,
when
,
then
})
=>
{
given
(
"
the user is not logged in and tries to navigate any deployment details page
"
,
async
()
=>
{
const
history
=
createMemoryHistory
();
history
.
push
(
"
/deployments/1
"
);
render
(
<
Router
history
=
{
history
}
>
<
App
/>
<
/Router
>
);
await
screen
.
findByText
(
/deployment details/i
);
}
);
then
(
"
they should not get Access deniend
"
,
async
()
=>
{
expect
(
await
screen
.
findByText
(
/Running Undeployment/i
)
).
toBeInTheDocument
();
});
});
/* test('Logged in user wants to navigate to a specific IOC deployment', ({ given, when, then }) => {
given('the user is on the deployments page', async () => {
const history = createMemoryHistory();
history.push('/deployments')
const { container } = render(
<Router history={history}>
<App />
</Router>
)
await findByText(container, /my deployments/i);
});
when('the user clicks on the deployment in the table', async () => {
const history = createMemoryHistory();
history.push('/deployments/1')
render(
<Router history={history}>
<App />
</Router>
)
await screen.findByTestId("deployment-details-container")
});
then('the user should be redirected to the deployment details page.', async () => {
expect(await screen.findByText(/the deployment is queued/i)).toBeInTheDocument()
});
});*/
});
Loading