@@ -4,6 +4,7 @@ import { NavigationMenuPage } from '../model/recruiting/navigation-menu-page'
4
4
import { CompaniesPage } from '../model/recruiting/companies-page'
5
5
import { NewCompany } from '../model/recruiting/types'
6
6
import { CompanyDetailsPage } from '../model/recruiting/company-details-page'
7
+ import { DEFAULT_USER } from '../tracker/tracker.utils'
7
8
8
9
test . use ( {
9
10
storageState : PlatformSetting
@@ -86,4 +87,36 @@ test.describe('Companies tests', () => {
86
87
await navigationMenuPage . clickButtonCompanies ( )
87
88
await companiesPage . checkCompanyNotExist ( deleteCompany . name )
88
89
} )
90
+
91
+ test ( 'Filtering companies' , async ( { page } ) => {
92
+ const firstCompany : NewCompany = {
93
+ name : `Company for filtering one-${ generateId ( ) } `
94
+ }
95
+ const secondCompany : NewCompany = {
96
+ name : `Company for filtering two-${ generateId ( ) } `
97
+ }
98
+ await test . step ( 'Create companies' , async ( ) => {
99
+ await navigationMenuPage . clickButtonCompanies ( )
100
+ await companiesPage . createNewCompany ( firstCompany )
101
+ await companiesPage . checkCompanyExist ( firstCompany . name )
102
+ await companiesPage . createNewCompany ( secondCompany )
103
+ await companiesPage . checkCompanyExist ( secondCompany . name )
104
+ } )
105
+ await test . step ( 'Filtering by creator' , async ( ) => {
106
+ await companiesPage . selectFilter ( 'Created by' , DEFAULT_USER )
107
+ await companiesPage . pressEscape ( )
108
+ await companiesPage . checkCompanyExist ( firstCompany . name )
109
+ await companiesPage . checkCompanyExist ( secondCompany . name )
110
+ } )
111
+ await test . step ( 'Filtering by name' , async ( ) => {
112
+ await companiesPage . selectFilter ( 'Name' , firstCompany . name , companiesPage . addFilterButton ( ) )
113
+ await companiesPage . checkCompanyExist ( firstCompany . name )
114
+ await companiesPage . checkCompanyNotExist ( secondCompany . name )
115
+ } )
116
+ await test . step ( 'Remove name filter' , async ( ) => {
117
+ await companiesPage . removeFilterOption ( 'Name' )
118
+ await companiesPage . checkCompanyExist ( firstCompany . name )
119
+ await companiesPage . checkCompanyExist ( secondCompany . name )
120
+ } )
121
+ } )
89
122
} )
0 commit comments