@@ -486,7 +486,7 @@ describe('Dashboards > Detail', () => {
486
486
await waitFor ( ( ) => expect ( mockVisit ) . toHaveBeenCalledTimes ( 1 ) ) ;
487
487
488
488
// Enter edit mode.
489
- await userEvent . click ( screen . getByRole ( 'button' , { name : 'Edit Dashboard ' } ) ) ;
489
+ await userEvent . click ( screen . getByRole ( 'button' , { name : 'edit-dashboard ' } ) ) ;
490
490
491
491
// Remove the second and third widgets
492
492
await userEvent . click (
@@ -585,7 +585,7 @@ describe('Dashboards > Detail', () => {
585
585
) ;
586
586
587
587
// Enter edit mode.
588
- await userEvent . click ( await screen . findByRole ( 'button' , { name : 'Edit Dashboard ' } ) ) ;
588
+ await userEvent . click ( await screen . findByRole ( 'button' , { name : 'edit-dashboard ' } ) ) ;
589
589
expect ( await screen . findByRole ( 'button' , { name : 'Add Widget' } ) ) . toBeInTheDocument ( ) ;
590
590
} ) ;
591
591
@@ -657,7 +657,7 @@ describe('Dashboards > Detail', () => {
657
657
) ;
658
658
659
659
// Enter edit mode.
660
- await userEvent . click ( await screen . findByRole ( 'button' , { name : 'Edit Dashboard ' } ) ) ;
660
+ await userEvent . click ( await screen . findByRole ( 'button' , { name : 'edit-dashboard ' } ) ) ;
661
661
expect ( screen . queryByRole ( 'button' , { name : 'Add widget' } ) ) . not . toBeInTheDocument ( ) ;
662
662
} ) ;
663
663
@@ -773,10 +773,10 @@ describe('Dashboards > Detail', () => {
773
773
}
774
774
) ;
775
775
776
- await userEvent . click ( await screen . findByText ( 'Edit Dashboard' ) ) ;
776
+ await userEvent . click ( await screen . findByRole ( 'button' , { name : 'edit-dashboard' } ) ) ;
777
777
await userEvent . click ( await screen . findByText ( 'Save and Finish' ) ) ;
778
778
779
- expect ( screen . getByText ( 'Edit Dashboard' ) ) . toBeInTheDocument ( ) ;
779
+ expect ( screen . getByRole ( 'button' , { name : 'edit-dashboard' } ) ) . toBeInTheDocument ( ) ;
780
780
expect ( mockPut ) . not . toHaveBeenCalled ( ) ;
781
781
} ) ;
782
782
@@ -826,7 +826,7 @@ describe('Dashboards > Detail', () => {
826
826
}
827
827
) ;
828
828
829
- await userEvent . click ( await screen . findByText ( 'Edit Dashboard' ) ) ;
829
+ await userEvent . click ( await screen . findByRole ( 'button' , { name : 'edit-dashboard' } ) ) ;
830
830
const widget = ( await screen . findByText ( 'First Widget' ) ) . closest (
831
831
'.react-grid-item'
832
832
) as HTMLElement ;
@@ -882,7 +882,7 @@ describe('Dashboards > Detail', () => {
882
882
}
883
883
) ;
884
884
885
- await userEvent . click ( await screen . findByText ( 'Edit Dashboard' ) ) ;
885
+ await userEvent . click ( await screen . findByRole ( 'button' , { name : 'edit-dashboard' } ) ) ;
886
886
await userEvent . click ( await screen . findByText ( 'Cancel' ) ) ;
887
887
888
888
expect ( window . confirm ) . not . toHaveBeenCalled ( ) ;
@@ -1476,7 +1476,7 @@ describe('Dashboards > Detail', () => {
1476
1476
) ;
1477
1477
} ) ;
1478
1478
1479
- it ( 'disables the Edit Dashboard button when there are unsaved filters' , async ( ) => {
1479
+ it ( 'disables the edit-dashboard button when there are unsaved filters' , async ( ) => {
1480
1480
const router = RouterFixture ( {
1481
1481
location : {
1482
1482
...LocationFixture ( ) ,
@@ -1534,7 +1534,7 @@ describe('Dashboards > Detail', () => {
1534
1534
1535
1535
expect ( await screen . findByText ( 'Save' ) ) . toBeInTheDocument ( ) ;
1536
1536
expect ( screen . getByTestId ( 'filter-bar-cancel' ) ) . toBeInTheDocument ( ) ;
1537
- expect ( screen . getByRole ( 'button' , { name : 'Edit Dashboard ' } ) ) . toBeDisabled ( ) ;
1537
+ expect ( screen . getByRole ( 'button' , { name : 'edit-dashboard ' } ) ) . toBeDisabled ( ) ;
1538
1538
} ) ;
1539
1539
1540
1540
it ( 'ignores the order of selection of page filters to render unsaved filters' , async ( ) => {
@@ -1875,9 +1875,9 @@ describe('Dashboards > Detail', () => {
1875
1875
}
1876
1876
) ;
1877
1877
1878
- await userEvent . click ( await screen . findByText ( 'Edit Access :' ) ) ;
1878
+ await userEvent . click ( await screen . findByText ( 'Editors :' ) ) ;
1879
1879
expect ( screen . getByText ( 'Creator' ) ) . toBeInTheDocument ( ) ;
1880
- expect ( screen . getByText ( 'All users ' ) ) . toBeInTheDocument ( ) ;
1880
+ expect ( screen . getByText ( 'All Users ' ) ) . toBeInTheDocument ( ) ;
1881
1881
} ) ;
1882
1882
1883
1883
it ( 'creates and updates new permissions for dashboard with no edit perms initialized' , async ( ) => {
@@ -1906,16 +1906,16 @@ describe('Dashboards > Detail', () => {
1906
1906
deprecatedRouterMocks : true ,
1907
1907
}
1908
1908
) ;
1909
- await userEvent . click ( await screen . findByText ( 'Edit Access :' ) ) ;
1909
+ await userEvent . click ( await screen . findByText ( 'Editors :' ) ) ;
1910
1910
1911
1911
// deselects 'All users' so only creator has edit access
1912
- expect ( await screen . findByText ( 'All users ' ) ) . toBeEnabled ( ) ;
1913
- expect ( await screen . findByRole ( 'option' , { name : 'All users ' } ) ) . toHaveAttribute (
1912
+ expect ( await screen . findByText ( 'All Users ' ) ) . toBeEnabled ( ) ;
1913
+ expect ( await screen . findByRole ( 'option' , { name : 'All Users ' } ) ) . toHaveAttribute (
1914
1914
'aria-selected' ,
1915
1915
'true'
1916
1916
) ;
1917
- await userEvent . click ( screen . getByRole ( 'option' , { name : 'All users ' } ) ) ;
1918
- expect ( await screen . findByRole ( 'option' , { name : 'All users ' } ) ) . toHaveAttribute (
1917
+ await userEvent . click ( screen . getByRole ( 'option' , { name : 'All Users ' } ) ) ;
1918
+ expect ( await screen . findByRole ( 'option' , { name : 'All Users ' } ) ) . toHaveAttribute (
1919
1919
'aria-selected' ,
1920
1920
'false'
1921
1921
) ;
@@ -1973,16 +1973,16 @@ describe('Dashboards > Detail', () => {
1973
1973
deprecatedRouterMocks : true ,
1974
1974
}
1975
1975
) ;
1976
- await userEvent . click ( await screen . findByText ( 'Edit Access :' ) ) ;
1976
+ await userEvent . click ( await screen . findByText ( 'Editors :' ) ) ;
1977
1977
1978
1978
// selects 'All users' so everyone has edit access
1979
- expect ( await screen . findByText ( 'All users ' ) ) . toBeEnabled ( ) ;
1980
- expect ( await screen . findByRole ( 'option' , { name : 'All users ' } ) ) . toHaveAttribute (
1979
+ expect ( await screen . findByText ( 'All Users ' ) ) . toBeEnabled ( ) ;
1980
+ expect ( await screen . findByRole ( 'option' , { name : 'All Users ' } ) ) . toHaveAttribute (
1981
1981
'aria-selected' ,
1982
1982
'false'
1983
1983
) ;
1984
- await userEvent . click ( screen . getByRole ( 'option' , { name : 'All users ' } ) ) ;
1985
- expect ( await screen . findByRole ( 'option' , { name : 'All users ' } ) ) . toHaveAttribute (
1984
+ await userEvent . click ( screen . getByRole ( 'option' , { name : 'All Users ' } ) ) ;
1985
+ expect ( await screen . findByRole ( 'option' , { name : 'All Users ' } ) ) . toHaveAttribute (
1986
1986
'aria-selected' ,
1987
1987
'true'
1988
1988
) ;
@@ -2061,10 +2061,10 @@ describe('Dashboards > Detail', () => {
2061
2061
deprecatedRouterMocks : true ,
2062
2062
}
2063
2063
) ;
2064
- await userEvent . click ( await screen . findByText ( 'Edit Access :' ) ) ;
2064
+ await userEvent . click ( await screen . findByText ( 'Editors :' ) ) ;
2065
2065
2066
- expect ( await screen . findByText ( 'All users ' ) ) . toBeEnabled ( ) ;
2067
- expect ( await screen . findByRole ( 'option' , { name : 'All users ' } ) ) . toHaveAttribute (
2066
+ expect ( await screen . findByText ( 'All Users ' ) ) . toBeEnabled ( ) ;
2067
+ expect ( await screen . findByRole ( 'option' , { name : 'All Users ' } ) ) . toHaveAttribute (
2068
2068
'aria-selected' ,
2069
2069
'false'
2070
2070
) ;
@@ -2136,8 +2136,8 @@ describe('Dashboards > Detail', () => {
2136
2136
}
2137
2137
) ;
2138
2138
2139
- await screen . findByText ( 'Edit Access :' ) ;
2140
- expect ( screen . getByRole ( 'button' , { name : 'Edit Dashboard ' } ) ) . toBeDisabled ( ) ;
2139
+ await screen . findByText ( 'Editors :' ) ;
2140
+ expect ( screen . getByRole ( 'button' , { name : 'edit-dashboard ' } ) ) . toBeDisabled ( ) ;
2141
2141
expect ( screen . getByRole ( 'button' , { name : 'Add Widget' } ) ) . toBeDisabled ( ) ;
2142
2142
} ) ;
2143
2143
@@ -2202,8 +2202,8 @@ describe('Dashboards > Detail', () => {
2202
2202
}
2203
2203
) ;
2204
2204
2205
- await screen . findByText ( 'Edit Access :' ) ;
2206
- expect ( screen . getByRole ( 'button' , { name : 'Edit Dashboard ' } ) ) . toBeDisabled ( ) ;
2205
+ await screen . findByText ( 'Editors :' ) ;
2206
+ expect ( screen . getByRole ( 'button' , { name : 'edit-dashboard ' } ) ) . toBeDisabled ( ) ;
2207
2207
expect ( screen . getByRole ( 'button' , { name : 'Add Widget' } ) ) . toBeDisabled ( ) ;
2208
2208
await userEvent . click ( await screen . findByLabelText ( 'Widget actions' ) ) ;
2209
2209
expect (
@@ -2219,7 +2219,7 @@ describe('Dashboards > Detail', () => {
2219
2219
) ;
2220
2220
} ) ;
2221
2221
2222
- it ( 'renders favorite button in unfavorited state' , async ( ) => {
2222
+ it ( 'renders favorite button in Unstard state' , async ( ) => {
2223
2223
const router = RouterFixture ( {
2224
2224
location : LocationFixture ( ) ,
2225
2225
params : { orgId : 'org-slug' , dashboardId : '1' } ,
@@ -2248,9 +2248,9 @@ describe('Dashboards > Detail', () => {
2248
2248
}
2249
2249
) ;
2250
2250
2251
- const favoriteButton = await screen . findByLabelText ( 'dashboards-favourite ' ) ;
2251
+ const favoriteButton = await screen . findByLabelText ( 'star-dashboard ' ) ;
2252
2252
expect ( favoriteButton ) . toBeInTheDocument ( ) ;
2253
- expect ( await screen . findByLabelText ( 'Favorite ' ) ) . toBeInTheDocument ( ) ;
2253
+ expect ( await screen . findByLabelText ( 'Star ' ) ) . toBeInTheDocument ( ) ;
2254
2254
} ) ;
2255
2255
2256
2256
it ( 'renders favorite button in favorited state' , async ( ) => {
@@ -2282,9 +2282,9 @@ describe('Dashboards > Detail', () => {
2282
2282
}
2283
2283
) ;
2284
2284
2285
- const favoriteButton = await screen . findByLabelText ( 'dashboards-favourite ' ) ;
2285
+ const favoriteButton = await screen . findByLabelText ( 'star-dashboard ' ) ;
2286
2286
expect ( favoriteButton ) . toBeInTheDocument ( ) ;
2287
- expect ( await screen . findByLabelText ( 'UnFavorite ' ) ) . toBeInTheDocument ( ) ;
2287
+ expect ( await screen . findByLabelText ( 'Unstar ' ) ) . toBeInTheDocument ( ) ;
2288
2288
} ) ;
2289
2289
2290
2290
it ( 'toggles favorite button' , async ( ) => {
@@ -2322,12 +2322,12 @@ describe('Dashboards > Detail', () => {
2322
2322
}
2323
2323
) ;
2324
2324
2325
- const favoriteButton = await screen . findByLabelText ( 'dashboards-favourite ' ) ;
2325
+ const favoriteButton = await screen . findByLabelText ( 'star-dashboard ' ) ;
2326
2326
expect ( favoriteButton ) . toBeInTheDocument ( ) ;
2327
2327
2328
- expect ( await screen . findByLabelText ( 'UnFavorite ' ) ) . toBeInTheDocument ( ) ;
2328
+ expect ( await screen . findByLabelText ( 'Unstar ' ) ) . toBeInTheDocument ( ) ;
2329
2329
await userEvent . click ( favoriteButton ) ;
2330
- expect ( await screen . findByLabelText ( 'Favorite ' ) ) . toBeInTheDocument ( ) ;
2330
+ expect ( await screen . findByLabelText ( 'Star ' ) ) . toBeInTheDocument ( ) ;
2331
2331
} ) ;
2332
2332
2333
2333
describe ( 'widget builder redesign' , ( ) => {
0 commit comments