Skip to content

Commit a797862

Browse files
committed
test(policy): cover create scope prompt dialog flow
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 43de34e commit a797862

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/tests/views/Settings/SettingsPolicyWorkbench.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ describe('RealPolicyWorkbench.vue', () => {
6161
})
6262
})
6363

64-
it('shows a dedicated create scope selector independent from the filter', async () => {
64+
it('asks what scope to create when clicking create rule', async () => {
6565
const wrapper = mountWorkbench()
6666

6767
const openPolicyButton = wrapper.findAll('button').find((button) => button.text().includes('Open policy'))
6868
expect(openPolicyButton).toBeTruthy()
6969
await openPolicyButton?.trigger('click')
70+
await wrapper.findAll('button').find((button) => button.text() === 'Create rule')?.trigger('click')
7071

71-
expect(wrapper.text()).toContain('Create in')
72-
expect(wrapper.text()).toContain('Create rule')
73-
expect(wrapper.text()).not.toContain('Select Instance, Group, or User in the scope filter before creating a rule')
72+
expect(wrapper.text()).toContain('Choose the level where the new rule should be created')
73+
expect(wrapper.text()).toContain('Instance')
74+
expect(wrapper.text()).toContain('Group')
75+
expect(wrapper.text()).toContain('User')
7476
})
7577

7678
it('shows callout when there is no persisted global default rule', async () => {

0 commit comments

Comments
 (0)